Author Topic: tiny mci multimedia player  (Read 41369 times)

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
tiny mci multimedia player
« on: July 28, 2014, 06:25:24 AM »
Hello. I'm trying to make a tiny mci multimedia player. This is the very-very-very first version though operative. You can open a midi-mp3-wav-etc file and then play it, also stop and reanude it, and can demand a looping play of it. At least en W7 works fine... more or less. I need to insert a beep at the end of the file to reanude it from the begining, need to fix it.

I want to implement it a basic ... don't know how to name it... graphic bar guided by the music?. One status bar (I think it is not so hard), and one volume bar (not hard neither). And an avi player (not hard). The more difficult could be the first one.

In short. Any info about that?

By the way, 512Kb of size is a bit low limit...  :redface:

Regards,
alfonso
The logic of the error is hidden among the most unexpected lines of the program

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: tiny mci multimedia player
« Reply #1 on: July 28, 2014, 07:29:18 AM »
you can probably just use a "slider" aka trackbar - somewhat similar to a scrollbar

http://msdn.microsoft.com/en-us/library/windows/desktop/bb760149%28v=vs.85%29.aspx

if you want to use CreateWindowEx, you can use the predefined system class:

Code: [Select]
szTrkBarClass   db 'msctls_trackbar32',0

TouEnMasm

  • Member
  • *****
  • Posts: 1764
    • EditMasm
Re: tiny mci multimedia player
« Reply #2 on: July 29, 2014, 02:13:26 AM »
A very good one is VLC.His author said that he is good because he don't use API as you do.
http://msdn.microsoft.com/en-us/library/windows/desktop/ff819076(v=vs.85).aspx
The mediaobj.h(.sdk) is part of the windows sdk
Perhaps wincodecsdk.h(.sdk) could help in this.
 
Fa is a musical note to play with CL

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: tiny mci multimedia player
« Reply #3 on: July 29, 2014, 05:55:46 AM »
You need direct access to the audio buffer to create a sound bar or oscilloscope. Is this possible with the MCI api ?
You can do this if you use ACM-codecs.
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: tiny mci multimedia player
« Reply #4 on: August 03, 2014, 10:14:58 PM »
Hello, thank you all for your responses. I've been a few days on hollidays and didn't watch them. I've had few time to work on the program, but it already has several interesting features: we already know how long is the file we are playing and for what position we are, hence it would be easy to add a track bar.

In the other hand, it can play several formats, including films avi, you can check it. Also can play in a loop if you click in the 8th button (loop icon) or just one time if you click it once again.

Nevertheless, i have to control better when the file ends playing and polish many things.

Also, i'd like to add an oscilloscope bar, but this seems to be not so easy to implement, though this is a main point to me because, controlling this, can be used in demos for sincronizing graphics and sounds.

My objective is not to make a multimedia player in the usual way, just play a bit with sound programming.

I think that it is amazing you can make a simply (but functional) multimedia player in a few kilo bytes.

Regards
The logic of the error is hidden among the most unexpected lines of the program

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: tiny mci multimedia player
« Reply #5 on: August 04, 2014, 03:05:29 AM »
a spectrum analyzer would be a nice feature (rather than an oscilloscope)
i bet Marinus has some code for that   :t

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: tiny mci multimedia player
« Reply #6 on: August 04, 2014, 06:24:02 AM »
Ever thought of using directsound ?
It's easy to set up and you have full control of the sounddata in the sound buffers.
With a bit of timing stuff you can draw a scope or whatever and synchronise graphics etc.

Lately i was busy programming a (ACM codec) mp3 player, wich is a pain in the a**. There are so many corrupt mp3 files that crashed my proggy.
So i made a little proggy to analyze the mp3 files to find the errors and correct them on the fly so they could play in my proggy or else skip the song.

It's fun to watch graphics that reacts to the music.  :biggrin:
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: tiny mci multimedia player
« Reply #7 on: August 07, 2014, 04:53:06 PM »
Hello. Track bars added but not fully functional, and any other minor changes.

Regards
The logic of the error is hidden among the most unexpected lines of the program

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: tiny mci multimedia player
« Reply #8 on: August 07, 2014, 10:18:35 PM »
Alfonso,

works fine under Windows 7-64. The language is Spanish, isn't it?

Gunther
You have to know the facts before you can distort them.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: tiny mci multimedia player
« Reply #9 on: August 07, 2014, 10:55:18 PM »
Yes, it is.

Flat buttons seem to be more stylish than 3d ones  :icon_rolleyes:
The logic of the error is hidden among the most unexpected lines of the program

FORTRANS

  • Member
  • *****
  • Posts: 1238
Re: tiny mci multimedia player
« Reply #10 on: August 07, 2014, 11:17:17 PM »
Hi,

   Works for MP3 and WAV files under Windows 2000.  An AVI
file opened, but did not play (I think).  Looks a bit odd though.
Attached is a screen shot of it.

Cheers,

Steve N.

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: tiny mci multimedia player
« Reply #11 on: August 08, 2014, 05:09:05 AM »
Mp3 Wav and Avi play well under Windows 8.1 64 bit.
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: tiny mci multimedia player
« Reply #12 on: August 08, 2014, 04:50:40 PM »
My aim is to make a multimedia player as tiny as i can, doing the minimum win api calls, so i made icons using system fonts webdings and wingdings, but i can see that not everybody has them...  :biggrin: Systems fonts size can take effect too  :biggrin:

 :( :redface: :(

One way to fix it should be using images, but this will increase the exe size...

The aspect of the window should be this one (didn't show the imagen in the zip???):

Thank you for your help,
alfonso
The logic of the error is hidden among the most unexpected lines of the program

sinsi

  • Guest
Re: tiny mci multimedia player
« Reply #13 on: August 08, 2014, 05:58:02 PM »
Playing so far: avi, wmv, wma, mp3, mp4, flv, aif
Windows 8.1 Pro with Media Center, also shark007's codec pack probably helps :biggrin:

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: tiny mci multimedia player
« Reply #14 on: August 08, 2014, 06:30:41 PM »
Thank you sinsi. Everybody sees the player as i attached before? I see that FORTRANS can not, maybe he has not any of the fonts used... It should be a pity to have using images instead of fonts, though only increases in 11 kb the size of the exe, maybe even less. :idea:

Regards
« Last Edit: August 08, 2014, 09:44:07 PM by avcaballero »
The logic of the error is hidden among the most unexpected lines of the program