Discussion:
[BitPim-devel] Re: [bitpim-cvs-checkins] bitpim midifile.py,NONE,1 .1 fileinfo.py,1.11,1.12
d***@netzero.com
2005-01-16 17:07:51 UTC
Permalink
The reason I didn't take that approach was because I wanted to mainly
deal with correct MP3 files (ie without gratuitious junk at the
begining).
I remember you mentioned something like that previously. But as you also stated, I need that patch to work with the MP3 files generated by ffmpeg. btw, can you double check the ID3 format?
Is the backing up one byte still needed as you fixed the other frame >length bugs?
Since you have the check in place, I just left it there; who knows what else might be screwed up out there.
I think you'll find I don't have any copyright on that file :-)
My apology. I blamed it on lazy-copy-and-paste :-)
As a stylistic issue there is no need for code like that. Just name >the variable self.time_delta. You can make it a property in the >future without affecting any calling code. It is also generally not >recommended to use double underscores unless you expect derived >classes to want to create something with the same name.
I guess that's the mentality carried over from my C++ days, in which all instance variables are supposed to be private and exposed only via accessors. The property feature of Python allows me to do that very nicely and conveniently.
I presume a variant of the code could also be used to do clipping of
midi files, although that isn't very high up on the priority list.
Yes, I was waiting for your conversion dialog to figure out how best to allow users to do that.

-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!
Roger Binns
2005-01-17 06:03:18 UTC
Permalink
Post by d***@netzero.com
btw, can you double check the ID3 format?
It definitely was correct. I used winamp to make the various combinations of
ID3v1 and ID3v2 and they are still correct :-)
Post by d***@netzero.com
Since you have the check in place, I just left it there; who knows what else
might be screwed up out there.
Ok. I'll remove the check since it was only there due to my bad code.
Post by d***@netzero.com
I guess that's the mentality carried over from my C++ days, in which all
instance variables are supposed to be private and exposed only via accessors.
The property feature of Python allows me to do that very nicely and conveniently.
In the very first Python code I wrote however many years ago, I tried to do
something similar but auto-making the functions. It was something hideous
like:

def __init__(self):
for prop in ("length", "duration", "oranges", "apples"):
... make getProp function ...
... make setProp function ...

(That would be a mangling of the JavaBean accessors with Python. I got very
confused due to Python's scoping when declaring classes and what namespace
is present.)
Post by d***@netzero.com
I presume a variant of the code could also be used to do clipping of
midi files, although that isn't very high up on the priority list.
Yes, I was waiting for your conversion dialog to figure out how best
to allow users to do that.
I would recommend just doing a seperate dialog using the ranged slider.
Things are made all the more complicated due to the lack of any standard
way of playing midi files. There are many many different projects named
pymidi, all supporting different platforms and having wacky licenses.

Roger
d***@netzero.com
2005-01-17 06:15:51 UTC
Permalink
Post by Roger Binns
Ok. I'll remove the check since it was only there due to my bad code.
I would keep it since having gone through this excercise, I don't trust those mp3 files available out there any more :-)
Post by Roger Binns
I would recommend just doing a seperate dialog using the ranged >slider.
Should we add this capability (possibly via the context menu) to all audio formats that can be trimmed?

-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!
Roger Binns
2005-01-17 06:31:19 UTC
Permalink
Post by d***@netzero.com
Post by Roger Binns
Ok. I'll remove the check since it was only there due to my bad code.
I would keep it since having gone through this excercise, I don't trust
those mp3 files available out there any more :-)
Yes, but bad files could be off by more than one byte in either direction.
The code was failing on mp3 produced by ffmpeg which was a critical
problem.

I would much rather not be lenient in what we accept, and then when
failures happen analyse why it is happening and address it then.
Your fixed code hasn't had any issues on any mp3 files I have thrown
at it.
Post by d***@netzero.com
Post by Roger Binns
I would recommend just doing a seperate dialog using the ranged >slider.
Should we add this capability (possibly via the context menu) to all
audio formats that can be trimmed?
Sure. I think it is fairly low priority since people can always
re-import the originals and do the chopping then. And for midi files,
the only people who have originals are musicians and the like and
they already have way better tools for clipping them. QCP clipping
probably would be the most useful.

If you are looking for another challenge, see if you can figure out
the motion jpeg format and what on earth ffmpeg produces for it.
(They don't seem to add up.)

The goal is to display videos in the wallpaper pane at about one
frame per second. My idea was to convert the video to mjpeg
and then extract the frame for the start of each second as a
jpeg. Finally the wallpaper pane would display the next frame
as each second ticks by. This is all to give a preview of the
video content, not to actually play it. To play and edit etc
the user will need an appropriate media player.

Roger

Loading...