~ubuntu-branches/ubuntu/natty/gnome-dvb-daemon/natty

« back to all changes in this revision

Viewing changes to src/Timer.vala

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-04-11 10:51:09 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100411105109-o84nb6bf7slexyq9
Tags: 0.1.16-2
* debian/patches/01_vala-0.8.0.patch:
  + Fix build with Vala 0.8.0, patches from upstream
    bzr (revisions 931, 932, 933) (Closes: #577293).

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
           
43
43
            this.Duration = duration;
44
44
            
 
45
            this.set_start_time (year, month, day, hour, minute);
 
46
        }
 
47
 
 
48
        public void set_start_time (int year, int month, int day, int hour,
 
49
                int minute)
 
50
        {
45
51
            this.starttime = Utils.create_time (year, month,
46
52
                day, hour, minute);
 
53
            this.update_epg_event ();
47
54
        }
48
55
        
49
56
        /**
211
218
            
212
219
            return (end_time < current_time);
213
220
        }
214
 
        
 
221
 
215
222
        public string to_string () {
216
223
            uint[] start = this.get_start_time ();
217
224
            return "channel: %u, start: %04u-%02u-%02u %02u:%02u, duration: %u".printf (
218
225
                this.Channel.Sid, start[0], start[1], start[2], start[3],
219
226
                start[4], this.Duration);
220
227
        }
221
 
        
 
228
 
 
229
        /**
 
230
         * Check if we can find an EPG event belonging to this recording
 
231
         */
 
232
        private void update_epg_event () {
 
233
            Schedule schedule = this.Channel.Schedule;
 
234
            Event? event = schedule.get_event_around (
 
235
                this.get_start_time_time (), this.Duration);
 
236
            if (event == null)
 
237
                this.EventID = 0;
 
238
            else
 
239
                this.EventID = event.id;
 
240
        }
 
241
 
222
242
        private time_t get_end_time_timestamp () {
223
243
            var t = Utils.create_time (this.starttime.year + 1900,
224
244
                this.starttime.month + 1, this.starttime.day,