示例#1
0
 def OnSelect(self, evt):
     day = evt.GetString()
     self.d_string = day
     dat = cal.str_date(day)
     if_exist = url.res_exist(dat)
     self.NoRes(if_exist)
     self.i = 0
     self.mms_urls = url.mms_url(dat)
     self.info_playing.SetLabel(self.d_string)
     self.OnStop(None)
     self.Media_list = self.Instance.media_list_new()
     for mms in self.mms_urls:
         self.Media_list.add_media(self.Instance.media_new_location(mms))
     self.playerl.set_media_list(self.Media_list)
     self.playerl.set_media_player(self.player)
     if self.playerl.play() == -1:
         self.errorDialog('Unable to play.')
     else:
         self.timer.Start(1,)
     self.volslider.SetValue(self.player.audio_get_volume() / 2)
示例#2
0
    def SetCustom(self, evt):
        year = self.custom_year.GetValue()
        month = self.custom_month.GetValue()
        day = self.custom_day.GetValue()
        self.d_string = '%-4s-%2s-%-2s' % (year, month, day)
        dat = cal.str_date(self.d_string)
        if_exist = url.res_exist(dat)
        self.NoRes(if_exist)
        self.i = 0
        self.mms_urls = url.mms_url(dat)
        self.info_playing.SetLabel(self.d_string)

        self.OnStop(None)
        self.Media_list = self.Instance.media_list_new()
        for mms in self.mms_urls:
            self.Media_list.add_media(self.Instance.media_new_location(mms))
        self.playerl.set_media_list(self.Media_list)
        self.playerl.set_media_player(self.player)
        if self.playerl.play() == -1:
            self.errorDialog('Unable to play.')
        else:
            self.timer.Start(1,)
        self.volslider.SetValue(self.player.audio_get_volume() / 2)