NAMP - Navision Audio Media Player

Hi all, some days ago we ‘talked’ about a media player in Navision. I thought: Why not? I’ve played a little bit with the Windows Media Player OCX and it works: Now I have a player in Navision (3.01B) [8D]. It isn’t really an audio media player but IMHO NAMP sounds better then NAP [:D]. It’s looks nice and works well. But there are still some problems. If somebody is interested in I can post more information and the code. Perhaps we can create an ‘OpenSource’ modul. And- before you ask why: Of course it doesn’t make sense but for me it is a kind of training and learning [:)]! Any opinions? (Perhaps I should this post in the OpenSubject- forum?) bye Andre

Hi Andre, count on me, after the post yesterday I also began playing around a bit and it would really be fun to develop this player [;)] Saludos Nils

Hi Nils, I will write a short overview and post it with the code on monday. bye Andre

Hi Andre, sounds great, then I’ll have a bit of time to get into the topic a bit over the weekend…and can’t wait for your info [:D] regarding the name: NAMP! - Navision Attain Music Player… and that won’t be no exageration at all [:p] (and it definitly sounds better than NAP) Saludos Nils

Hi Andre, Great idea! It was just this morning - under the shower [:p] - that it came to my mind that one could develop a sound module for Navision. But I thought of abusing the BEEP command (which we also talked about a few days ago), you know, like storing a list of frequency and duration values in a table and writing a codeunit that feeds this list into a loop of BEEPs [:D] Your approach is much more flexible and powerful, of course… [^] I’d be definitely interested in the source code!

Hi People, I have made something similar to what you guys have been discussing in my spare time, but its an MP3 player using the Media Player OCX, I am also working on the CD player if time permits but the MP3 Player with playlist is ready…if you want a copy, lemme know. I know there could have been more which I could do, but at the moment time isnt permitting me so all your inputs / additions are welcome to the code. Hey please send me the updates also ok Well its sad but the download section isnt working, so i can mail the objects if u need, lemme know I would be very much interested in working as team to develop some kinda add on for music world. Cheers & happy mp3ing

Hi Vishal, I’d really appreciate if you could send me your objects and let’s see how we can put together a development team for a really cool Navision Player [;)] My mail is n.michaelis@gmx.net Thanks & saludos Nils

Hi All, perhaps Vishal and I have done the same. Vishal please send my your objects to ptraxx@freenet.de. Thank you! Here is my Player http: //mitglied.lycos.de/PartyPlaner/navision/nampv0001.zip (This link doesn’t work no longer! LYCOS!![:(!]) I still have 4 big problems: (I forgot one [;)])

  • How can I play the tracks automatically? This means: When one track is finished the next track should start. It’s works with a playlist.
  • I can’t play CD’s. The same issue like Vishal [xx(]!
  • How can I scan the tracks (FastForward/FastReverse)?
  • NEWHow can I read the ID3 tags from the MP3-files?
    Here is my short overview: NAMP v0.001 Requirements: - Navision ! :wink: - OCX - granule - Windows Media Player Objects: Form 50099 - Player CodeUnit 5099 - OCX-access Valid files: MP3, WAV, RMI, M3U (Winamp-Playlist) Functions: Open Open a file or a playlist with ‘Common Dialog Management’ CU 412. Play Play the current file or playlist (from the start). If the ‘Pause’ - button was pressed before, play the current track further. Pause Make a pause. Stop Stop playing current file or playlist. Previous Different: If a file (track) is playing, search the current directory backwards and play the previous file. If current file = first file then go to the last file in the directory. If a playlist (m3u) is playing go to the previous track in playlist. << (FastReverse) Scan current track reverse. Doesn’t work! >> (FastForward) Scan current track forward. Doesn’t work! Next Different: If a file (track) is playing, search the current directory forward and play the next file. If current file = last file then go to the first file in the directory. If a playlist (m3u) is playing go to the next track in playlist. Quit Close window and quit OCX. Any help and ideas are welcome! bye Andre

Hi @ all I think to build/develop something like NAMP is a great think - listen to music during work :wink: You may count on me - I would like to join a team for a free NAMP (or something similar) :wink: @Andre_DDB: I try your player and send you my feedback :wink: baabaa, Ben

Hi Nils

quote:


Originally posted by nilsm
… regarding the name: NAMP! - Navision Attain Music Player… and that won’t be no exageration at all [:p] (and it definitly sounds better than NAP) …


If the player doesn’t work in NF (I don’t know!) I aggree with NAMP! - Navision Attain Music Player! Actually the name should be: MBSNAP! Microsoft Business Solutions Navision® Audio Player [:D] or MBSNMP! Microsoft Business Solutions Navision® Media Player [:D] Sorry, but I prefer NAMP! bye Andre

To read the ID3 info you can use a little ocx I have found called tagwriter from http://www.starting.com/timpysoft/ With this it is easy to get the info you require, heres one I prepared earlier Tagwrite.MP3_FileName(‘c:\a.mp3’); MESSAGE(Tagwrite.ID3tag_Title); Where Tagwriter is the OCX variable. The source code is included in the down load so it would be possible to borrow the code and write our own ocx. You may find you could use events and a single instance codeunit to tell when a song has finished. Paul Baxter

Ok so the source code is not included in tag writter but it seems to be just code stolen from vb-world. A class file for mp3 id tag info is available here http://216.26.168.92/graphics/tip507.html Paul Baxter

Hi NAMP team [;)] I figured out how to extract the MP3 Tag without using another OCX… in the end not that difficult, once you know where this stuff is stored…


GetMP3Tag(VAR MP3Tag : ARRAY [6] OF Text[30];TrackName : Text[250])
{
Tag As String * 3
Songname As String * 30
Artist As String * 30
Album As String * 30
Year As String * 4
Comment As String * 30
Genre As String * 1
}

f.TEXTMODE(FALSE);
f.WRITEMODE(FALSE);
IF EXISTS(TrackName) THEN
  f.OPEN(TrackName)
ELSE
  EXIT;

f.SEEK(f.LEN - 128);
f.READ(_Tag);

IF COPYSTR(_Tag,1,3) = 'TAG' THEN BEGIN
  MP3Tag[1] := COPYSTR(_Tag,4,30);     //Songname
  MP3Tag[2] := COPYSTR(_Tag,34,30);    //Artist
  MP3Tag[3] := COPYSTR(_Tag,64,30);    //Album
  MP3Tag[4] := COPYSTR(_Tag,94,4);     //Year
  MP3Tag[5] := COPYSTR(_Tag,98,30);    //Comment
  MP3Tag[6] := COPYSTR(_Tag,128,1);    //Genre
END;

f.CLOSE;

Writing to the MP3 Tag is also possible, just the other way around (Open the file with WRITEMODE(TRUE) and enter the text in the last 128 bytes of the MP3 file)

quote:


How can I play the tracks automatically? This means: When one track is finished the next track should start. It’s works with a playlist.


For the moment, I’d be also very much interested in how to solve this issue… that would make it possible to maintain the MP3 archive within Navision and to build your playlists within Navision… [:p]

quote:


Actually the name should be: MBSNAP! Microsoft Business Solutions Navision® Audio Player or MBSNMP! Microsoft Business Solutions Navision® Media Player


… just to make sure… the name should also be “pronouceable”, shouldn’t it??? [:D] Saludos Nils

That works for id3v1 type tags which are encoded as ascii in the last 128 bytes of the file. Id3v2 tages are at the begining of a file (Open an mp3 with wordpad if you don’t believe me). So if we only support ID3v2 we can add native Navision support and do away with an OCX altogether. Paul Baxter

Hi Nils

quote:


Originally posted by nilsm

quote:


… How can I play the tracks automatically? This means: When one track is finished the next track should start. It’s works with a playlist.


For the moment, I’d be also very much interested in how to solve this issue… that would make it possible to maintain the MP3 archive within Navision and to build your playlists within Navision… [:p] …


I havn’t much time at the moment but I’ve played with WMP.PLAYSTATE (Mediaplayer property) yesterday (with the following result). PLAYSTATE returns the following numbers Stop = 0 Play (after stop) = 6 Play (after pause) = 2 Pause = 1 Perhaps we can use this in connection with ‘SendPlayStateChangeEvents’ (another Mediaplayer property)[?].

quote:


quote:


Actually the name should be: MBSNAP! Microsoft Business Solutions Navision® Audio Player or MBSNMP! Microsoft Business Solutions Navision® Media Player


… just to make sure… the name should also be “pronouceable”, shouldn’t it??? [:D]


YEP [:D]!! bye Andre

Hi All, Probably a redundant remark, but has everybody seen the MP3 player on MyNavision.net?? /Sven

Thank you Sven! This is Vishal’s player. See the postings above. bye Andre

Hi folks,

quote:


How can I play the tracks automatically? This means: When one track is finished the next track should start. It’s works with a playlist.


worked a bit on that “automatic start” issue, and as windows media player is used to specific m3u playlists (in which case the “automatic start” does work fine) there is a need for a little workaround in Navision. I set the OnTimer of the player form to 1000, and check whether the file is already played completely every second… IF WMP.CurrentPosition = WMP.SelectionEnd THEN… If this is the case, you cancel the current file, move to the next file of the playlist and start playing the next file with wmp. Works fine with my player [:D] Saludos Nils

Hi, I have submitted my objects at http://www.mibuso.com, there were some errors that i have corrected and re-submitted so i dont know which of the objects are there in the download section. Thank you Paul I was really searching for something which would help me read the ID tags. I am currently working on displaying the Duration / Elapsed time of the song being played and offcourse trying to incorporate a Audio CD player for all music lovers, will let you know about any futher development. In the meantime if you have any suggestion or additions please do keep me updated. For those who have requested for my objects, they are on the way. Vishal

Hi Nils

quote:


Originally posted by nilsm
… I set the OnTimer of the player form to 1000, and check whether the file is already played completely every second… IF WMP.CurrentPosition = WMP.SelectionEnd THEN… …


The OnTimer was one of my first thoughts to solve this problem. But is testing every second not to much for the system? Now and then I have some other things to do in Navision [;)]! Every player shows time to play! Is the time (length) of the track somewhere stored? If it would be - then we could call OnTimer with ‘PlayTime’. But - I didn’t found the right method / property [:(]. bye Andre