Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added remaining code for processing AUDIO of VALARM for CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 13 Feb 2016 18:07:05 +0000 (18:07 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 13 Feb 2016 18:07:05 +0000 (18:07 +0000)
source/objects/calendarevent/CalendarEvent.cpp

index 3e25e86..b12d6c9 100644 (file)
@@ -1459,6 +1459,7 @@ void CalendarEventObject::ProcessData(){
        ProcessAlarms();
        
        int SeekCount = 0;
+       int AlarmObjectCount = 0;
        
        bool AlarmActionFound = false;
        
@@ -1471,6 +1472,7 @@ void CalendarEventObject::ProcessData(){
        
                bool AlarmActionFound = false;
                bool AlarmTriggerFound = false;
+               bool AlarmDurationFound = false;
                        
                DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], 
                                &EventAlarmData[SeekCount], false, "ACTION");
@@ -1524,7 +1526,7 @@ void CalendarEventObject::ProcessData(){
                
                // Process the data from TRIGGER.
                
-               DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "TRIGGER");
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "TRIGGER");
        
                if (DataReceived.begin() != DataReceived.end()){
        
@@ -1567,11 +1569,77 @@ void CalendarEventObject::ProcessData(){
                        }
                
                        NewAlarmData.TriggerData = DataReceived.begin()->second;
+                       AlarmTriggerFound = true;
+               
+               }
+               
+               // Process data from DURATION.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DURATION");
+               
+               if (DataReceived.begin() != DataReceived.end()){
+       
+                       try {
+                               NewAlarmData.DurationTokens = DataReceived.begin()->first.substr(9);
+                       }
+               
+                       catch(const out_of_range &oor){
+                               // Do nothing as there is no data.
+                       }               
+               
+                       NewAlarmData.DurationData = DataReceived.begin()->second;
+                       AlarmDurationFound = true;
+               
+               }
+               
+               // Process data from REPEAT.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "REPEAT");
+               
+               if (DataReceived.begin() != DataReceived.end() && AlarmDurationFound == true){
+       
+                       try {
+                               NewAlarmData.RepeatTokens = DataReceived.begin()->first.substr(7);
+                       }
+               
+                       catch(const out_of_range &oor){
+                               // Do nothing as there is no data.
+                       }               
+               
+                       NewAlarmData.RepeatData = DataReceived.begin()->second;
+               
+               } else {
+                       
+                       NewAlarmData.DurationData.clear();
+                       NewAlarmData.DurationTokens.clear();
+                       
+               }
+               
+               // Process data from X-*
+               
+               AlarmObjectCount = 0;
+               
+               for(vector<string>::iterator xtokeniter = EventAlarmName[SeekCount].begin(); 
+                       xtokeniter != EventAlarmName[SeekCount].end(); ++xtokeniter){
+                       
+                       bool TokenData = false;
+                       string PropertyTokens;
+               
+                       if (xtokeniter->substr(0,2) == "X-" &&
+                               xtokeniter->size() > 2){
+                       
+                               NewAlarmData.XTokensData.push_back(EventAlarmData[SeekCount][AlarmObjectCount]);
+                               NewAlarmData.XTokensDataTokens.push_back(EventAlarmName[SeekCount][AlarmObjectCount]);
+                               
+                       }
+               
+                       AlarmObjectCount++;
                
                }
                
                if (NewAlarmData.AlarmType == CALENDARALARM_AUDIO &&
-                       AlarmActionFound == true){
+                       AlarmActionFound == true &&
+                       AlarmTriggerFound == true){
                
                        CalendarAlarmData.push_back(NewAlarmData);
                        
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy