NAMP - Navision Audio Media Player

Hi Andre, The Length or the Duration, if returned by WinMediOCX property “Duration” Hope this helps. Any feedbacks on the MP3 Player ? Vishal

Hi Vishal

quote:


Originally posted by vshal
… The Length or the Duration, if returned by WinMediOCX property “Duration” Hope this helps. …


I don’t get the time with ‘Duration’. I receive allways 0 or -1. Perhaps I have to go to the end of file to get the full time. Do you have a working solution?

quote:


Originally posted by vshal
… Any feedbacks on the MP3 Player ? …


What should I say. We have a different way of doing the same: playing audio files. Your solution is more ‘Navision like’ my solution is more ‘Winamp like’. The basic technology is the same. IMHO we should share our knowledge with each other and with the other users of this forum further [:)]. Unfortunately I can’t import your player in our system. You use tables and number series. I think this is to much for a ‘private’ solution [;)]. Your playlist is interesting. Do you plan a possibility for the import/export of Winamp- playlists (m3u)? I would like to try this with a temporary table. My goals are:- play audio files OK

  • read the MP3 tags
  • read/play playlists (m3u) OK
  • write playlists (m3u)
    Regards from Berlin bye Andre

Hi Andre, You will get the Duration once the song starts playing, i am working on it and will update the objects soon I have also sent a Text version of the objects you can renumber and import the objects. At the moment, I play MP3 files, With help of an OCX read MP3 tags, Play lists as you will see the player works on play list basis

Hi Vishal

quote:


Originally posted by vshal
… I have also sent a Text version of the objects you can renumber and import the objects. …


Sorry this was a missunderstanding. I can’t use tables for this project. We have to pay for each object. Therefore I would like to use temporary tables.

quote:


With help of an OCX read MP3 tags, Play lists as you will see the player works on play list basis


I didn’t found it in your first version. I should download the latest version [;)]. bye Andre

Hi all, you’ve really been busy this time [;)]

quote:


The OnTimer was one of my first thoughts to solve this problem. But is testing every second not to much for the system?


I know, it might be a bit of a load for the system, it would be necessary to test whether this timer really consumes so much resources. To be honest, I have no clue, because it’s the first time I need this trigger…

quote:


Every player shows time to play! Is the time (length) of the track somewhere stored?


The track length is stored either in wmp.duration or WMP.SelectionEnd. I have played around a bit and have a timer, though there are problems of updating the form. It’s simply flickering too much…


OnTimer Trigger, Form Player (Timer Interval = 1000)

IF FullFileName <> '' THEN BEGIN
  cu_wmp.GetTimeInfo(TimeInfo,Finished);
  CurrForm.TimeInfo.UPDATE;
  IF Finished THEN
    GetNextSong;
END;


GetTimeInfo(VAR TimeInfo : Text[30];VAR Finished : Boolean) in CU cu_wmp
IF NOT ISCLEAR(WMP) THEN BEGIN
  TimeInfo := FORMAT(WMP.CurrentPosition/60,2,'<Integer>') + ':' + FORMAT(ROUND((WMP.CurrentPosition MOD 60),1,'<'),2) + ' / ';
  TimeInfo += FORMAT(WMP.SelectionEnd/60,2,'<Integer>') + ':' + FORMAT(ROUND((WMP.SelectionEnd MOD 60),1,'<'),2,'<Integer>');

  IF WMP.CurrentPosition = WMP.SelectionEnd THEN
    Finished := TRUE
  ELSE
    Finished := FALSE;

END;

I still have problems with the correct formatting but the idea should be clear. … and let’s keep on sharing, really fun to work this way [:D] Saludos Nils

Hi Nils, great work! [:D] I made some modifications. Please try it [;)]. Pay attention to the first line of GetTimeInfo [8D]!


Name	DataType	Subtype	Length
CMIN	Text		30
CSEC	Text		30
PMIN	Text		30
PSEC	Text		30

**GetTimeInfo(VAR TimeInfo : Text[30];VAR Finished : Boolean)**
//Thanks to NilsM
IF NOT ISCLEAR(WMP) THEN BEGIN
   CMIN:= FORMAT(WMP.CurrentPosition/60,2,'<Integer>');
   IF ROUND((WMP.CurrentPosition MOD 60),1,'<') < 10
     THEN  CSEC:= '0' + FORMAT(ROUND((WMP.CurrentPosition MOD 60),1,'<'))
     ELSE  CSEC:= FORMAT(ROUND((WMP.CurrentPosition MOD 60),1,'<'),2);
   
   PMIN:= FORMAT(WMP.SelectionEnd/60,2,'<Integer>');
   IF ROUND((WMP.SelectionEnd MOD 60),1,'<') < 10
     THEN  PSEC:= '0' + FORMAT(ROUND((WMP.SelectionEnd MOD 60),1,'<'))
     ELSE  PSEC:= FORMAT(ROUND((WMP.SelectionEnd MOD 60),1,'<'),2);

  TimeInfo := CMIN + ':' + CSEC + ' / ' + PMIN + ':' + PSEC;

 IF WMP.CurrentPosition = WMP.SelectionEnd THEN
     Finished := TRUE
   ELSE
     Finished := FALSE;
END;

bye Andre

Hi All, here is another slightly change in the PLAYER FORM code. This is necessary to avoid a jump to the next after next track in a m3u (WinAmp) - playlist.


**OnTimer()**
//Thanks to NilsM
IF TrackName <> '' THEN BEGIN
 "CU WMP".GetTimeInfo(TimeInfo,Finished);
 CurrForm.TimeInfo.UPDATE;   
 **IF NOT(LOWERCASE(COPYSTR(TrackName,STRLEN(TrackName)-3)) = '.m3u') THEN** //Playlist
  IF Finished THEN
    GetNextSong;
END;

P.S: I’m thinking about a major update of my player from v0.001 to v0.002 [:D]! bye Andre

fdgfdsgfgf

quote:


Originally posted by Andre DDB
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


Hey I know my posting, but what do you mean with:

quote:


Originally posted by emilepeels
fdgfdsgfgf


[?][?]

Hi Andre, thanks for that recognition - I really feel flattered [:D] And definitly your formatting was the part I was missing out. I hoped to solve it with the FORMAT parameters but this part didn’t work out… and your code achieves exactly that result. Great! And regarding that playlist condition - directly in the player I control a variables (UsePlaylist) that controls whether I use a Navision playlist or a playlist file - about the same way you handle IsPause and AppIsAlready. Before getting the new file, this condition gets checked… just for info… does your player form flicker aswell because of the necessary CurrForm.UPDATE - it doesn’t really look nice in my case. [:(] so the next one would be to read and write m3u files… doesn’t seem to be too difficult though… hint: #EXTINF:320 - refers to the title length in seconds… Saludos Nils

Hai Vishal, Can i share the Music objects with you… Regards, Vijay Kumar

Hi Vijay, Sure you can, its already at http://www.mibuso.com i have mentioned it my previous post. Just wanted to check the guys here, has anyone tried playing an Audio CD with the Media Player OCX, I tried but i couldnt, Paul your inputs are required i guess. like the MP3 ocx you had mentioned is there somthing similiar that can be used for a CD Player. Thanx a ton guys, hope you are enjoying the Muzik. Vishal

Hi Nils

quote:


Originally posted by nilsm
… just for info… does your player form flicker aswell because of the necessary CurrForm.UPDATE - it doesn’t really look nice in my case. [:(] … so the next one would be to read and write m3u files… doesn’t seem to be too difficult though… hint: #EXTINF:320 - refers to the title length in seconds…


My player doesn’t flicker. I don’t use CurrForm.UPDATE in this case. The CurrForm.TimeInfo.UPDATE updates only the control. @playlists: that was my thought too Unfortunately I’m on vacation in next two weeks [8D], but I hope you are not ready with this until I come back [;)]. @Vijay: You can download it here (It’s a new version!) http://www.mibuso.com/dlinfo.asp?FileID=166 bye Andre

Hi Andre,

quote:


My player doesn’t flicker. I don’t use CurrForm.UPDATE in this case. The CurrForm.TimeInfo.UPDATE updates only the control.


ok, this is good news, then the reason simply is that my machine is one of the older ones and I should test it with a faster cpu.

quote:


@playlists: that was my thought too Unfortunately I’m on vacation in next two weeks , but I hope you are not ready with this until I come back .


…eh, vacation - that’s what a call fortunate. Well, with your permission, we will keep on working on that stuff, but don’t worry, we’ll keep some additional features for you to develop. [;)] Saludos & enjoy the holidays… Nils

Hi Nils

quote:


Originally posted by nilsm
… …eh, vacation - that’s what a call fortunate. Well, with your permission, we will keep on working on that stuff, but don’t worry, we’ll keep some additional features for you to develop. [;)] …


Permission: OK [;)] At the moment I’m still in the office [xx(]. My plane departs on monday. But before I go to the islands I will realize the ‘major’ update of the player to version 0.002 (with your brilliant idea to get the time [:D]). Saludos <= I have to learn spanish [8D]. Andre

Hi all … I downloaded one of the very early versions of this very fun project. In that version a Windows Media Player DLL was being used instead of this new OCX. The reason for mentioning this is that with the DLL we can utilize on the events the automation variable uses when there is a change of e.g. PlayState. That way a whole directory can be played without the use of playlist. Or is this not an issue any more? Keep up the good work. With best regards, Guðlaugur Ingi

Hi Guðlaugur, somehow this is still an issue because we currently use a workaround with the OnTimer Trigger of the form that checks whether the end of the file has already been reached or not… Playstate doesn’t specify whether the file has been finished or hasn’t been opened yet, therefore not very reliable. On the other hand, you can’t call Navision triggers from outside Navision - therefore the OnTimer trigger is the only solution to check the current situation of the file… please correct me if my assumptions are wrong or let us know if you have another idea [;)] Saludos Nils

Hi Nils … Currently Navision can not handle events that OCXs use, but can with DLLs. So, try to use the Windows Media Player DLL as a variable, open the properties and put WithEvents to Yes. Then the CU (or where ever you are using the variable) will show all the events this DLL fires. So, in the case of the Windows Media Player it has e.g. this event: WMP::PlayStateChange(OldState : Integer;NewState : Integer) There you should be able to insert code to play the next song when the current one is done playing, given that you know which state is which. I tried this for 30 min. or so but could not get it to work in that time, although I am confident this should work. I tried to run this code when the event fired: IF (NewState = 0) AND (OldState = 2) THEN “WMP Next”; That did not do the trick and I didn´t have time to play around more. With best regards, Guðlaugur Ingi

Hi Nils & Guðlaugur, IMHO the solution from Nils is great. As a ‘nice’ small side effekt we get the time on the player. It works very well with two ‘tiny’ exceptions: NAMP - Known Issues [;)] ------------------------ If you play a file with a play time > 95 minutes you will get a wrong total time. (@Nils: No matter! WinAmp has an similar error with large files [:D]) If the system is strongly loaded, it can occur, that the return of played time needs longer than one second. The result: The track is finished before reaching the total time. I can live with both issues. bye Andre

Hi all, here is the latest version (v0.002) of my player. Our should I say (like a wellknown software company): NAMP 2003 (only internal BETA) Servicepack 1 [;)] http: //mitglied.lycos.de/PartyPlaner/navision/nampv0002.zip (This link doesn’t work no longer! LYCOS!![:(!]) Changes to previous version (v0.001): Player plays now all tracks automtically. => Thanks to NilsM Time (played/total) is visible. => Thanks to NilsM The ‘About’ - box is available on the ?. Some minor changes. Still open: - read MP3 tags - read / show / write m3u - playlists (play works already) - CD - Audio Sorry! Our language is german. So you will have to translate the objects. I tried to set all ML-properties to ENU. All suggestions are welcome. bye Andre (now on vacation for two weeks [8D])