Re: set playback position?

Marcus Brinkmann <[email protected]>
Newsgroups gmane.comp.audio.netmd.devel
Message-ID <20030102202445.GA407@ulysses>
On Thu, Jan 02, 2003 at 07:57:39PM +0000, Pete Bentley wrote:
> Ooof, I only really just sobred up really from a very long New Year's so
> I'm just replying to some of the easier messages tonight, I don't quite
> feel up to staring at big blocks of hex yet... :)

Sure, no problem :)
 
> On Thursday, Jan 2, 2003, at 03:35 Europe/London, Marcus Brinkmann 
> wrote:
> >when I tried out the omg jukebox program, I saw that you could move a
> >slider to set the current playback position in the current track.  I 
> >don't
> >remember having it actually tried out, but if it is possible on a netmd
> >device, has anybody sniffed out what happens in the background on the 
> >USB
> >protocol doing that?  This seems to me the only obvious gap in what 
> >openmg
> >jukebox has and we don't (apart from checking out music of course).
> 
> Yup, we can do this.
> 
> Check out the functions netmd_set_playback_position() and the slightly
> higher level omd_set_playback_position().
> 
> The slider in Xmd behaves exactly the same as the one in Open MG.

Yeah, I just realized that after generating debug output and tracing it :)

I got my incomplete information from netmd_cmd.c where you have:

int netmd_set_playback_track( omd_unit_t *unit, uint16 track )
{
    int rc = -1,
        p1 = 0x0000;

    netmd_cmd_buf_t *cmdbuf =
        netmd_simple_command( unit, 32, "001850 ff010000 WW",
                              p1, track );

But this is dangerous.  If I sent first
"001850 ff010000 0000 0001 00123400"

and then
"001850 ff010000 0000 0001"

the playback position will be at 12:34 in the second track, because the
internal buffer still has the 1234 around and the command does not honor the
too small request length.  I suggest that you always add the time position,
even if it is just 00000000.

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    [email protected]
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
[email protected]
http://www.marcus-brinkmann.de/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.