Discussion:
[BitPim-devel] Media Preview Panel
Adit Panchal
2005-04-04 21:37:45 UTC
Permalink
Since wxPython 2.5.4 includes the wx.media.MediaCtrl, I decided to get
the media preview panel working for the phonebook entry editor.

I almost have this working except I have one question regarding the
storage of the ringer information in pubsub. I noticed that the ringers
that have not been uploaded to the phone are marked with a 'u'. For
example: {'name': u'LeChuck.mid'}, and they do not contain origin
data. In my code, to determine whether a ringer is builtin or not, I
just check the origin. For these tuples without an origin, can I just
look for the 'u' with a startswith string test? Where does this 'u'
come from? Is it appended by pubsub itself, or by ringer.py?

Also, I have this working so that this media control panel shows as
another panel with a splitter on the ringers tab. This could be handy
so that someone doesn't have to launch an external program to listen to
the ringer. I think this could be extended in the future for video
previews. I wanted to make this similar to the HTML preview window for
the phonebook tab. Let me know if this is worth pursuing.

Adit
Adit Panchal
2005-04-04 21:47:24 UTC
Permalink
Post by Adit Panchal
I almost have this working except I have one question regarding the
storage of the ringer information in pubsub. I noticed that the
ringers that have not been uploaded to the phone are marked with a
'u'. For example: {'name': u'LeChuck.mid'}, and they do not contain
origin data. In my code, to determine whether a ringer is builtin or
not, I just check the origin. For these tuples without an origin, can
I just look for the 'u' with a startswith string test? Where does this
'u' come from? Is it appended by pubsub itself, or by ringer.py?
Never mind, unless there is a better way to do it, I got it to work by
this way:

if (not self._rtindex[k].has_key('origin')) or
(self._rtindex[k]['origin'] == 'ringers'):

So I am detecting it by checking whether the ringtone has a ringers
origin or does not have an origin at all.

Regardless, I am still curious where the 'u' comes from.

Adit
d***@netzero.com
2005-04-04 22:35:16 UTC
Permalink
Post by Adit Panchal
Regardless, I am still curious where the 'u' comes from.
type(u'test')
<type 'unicode'>

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Adit Panchal
2005-04-05 00:21:15 UTC
Permalink
Post by d***@netzero.com
type(u'test')
<type 'unicode'>
Gotcha. Thanks :)

I had another question, I need to access the config variables, but I
can't from where I am in phonebookentryeditor, since it does not have
mainwindow defined. What would be the best way to get the ringerpath
from config? I was passing mainwindow through phonebookentryeditor to
RingtoneEditor to my mediapreview panel, but that seems the long way to
go about it. Is there any other way to read the config that I am
overlooking?

Thanks,

Adit
Roger Binns
2005-04-05 02:40:04 UTC
Permalink
Post by Adit Panchal
Post by d***@netzero.com
type(u'test')
<type 'unicode'>
Gotcha. Thanks :)
Anything that has been through the UI will end up in unicode.
Post by Adit Panchal
I had another question, I need to access the config variables,
wx.GetApp().config

Roger
Roger Binns
2005-04-05 02:42:25 UTC
Permalink
Post by Adit Panchal
Since wxPython 2.5.4 includes the wx.media.MediaCtrl, I decided to get
the media preview panel working for the phonebook entry editor.
BTW that control isn't supported on Linux. I don't particularly mind
pressing ahead, but do make sure it fails "safe" in some way (eg to
a static bitmap widget).

Roger
Adit Panchal
2005-04-05 02:49:55 UTC
Permalink
Post by Roger Binns
BTW that control isn't supported on Linux. I don't particularly mind
pressing ahead, but do make sure it fails "safe" in some way (eg to
a static bitmap widget).
I was aware of the Linux issue and was going to use an image of the
ringer that was present before. Thanks for letting me know though.
Post by Roger Binns
Post by Adit Panchal
I had another question, I need to access the config variables,
wx.GetApp().config
Thanks - just what I needed.

Adit

Loading...