Sign in to follow this  
Followers 0

BMP - another media player v 1.7

35 posts in this topic

Posted (edited)

I have written another media player that I think is a little different than some of the others I have seen out there. Currently the functions that it has are:

1. Customizable colors, including the background color, and the music listings.

2. Sort music list by any column

3. Next and previous buttons, even if you have sorted the listview.

4. The program will read the ID3 tags of your MP3s using the BassTags.au3 UDF (Thanks BrettF)

5. Will check to see if there is any embedded picture files in your MP3 and if so will use that on the GUI for the music player. If it doesn’t find a picture file in the MP3 it will look for one in the folder that the file is in and use that instead. If it doesn’t find any pictures there it will use the default one that I have included. This uses the ID3.au3 UDF to read the picture info in the file.

6. Allows you to save the size and position of the windows when you exit, there are 3 options for this. You can choose to have it ask you every time, never save, always save.

7. Allows you to save the volume control setting, as well as whether or not you have random play (shuffle) set.

8. Allows you to save the state of the music list and will keep it the way it was when you quit the program.

9. Hotkeys are set for all of the relevant functions:

a. Play/Pause = Shift-CTRL-A

b. Next Song = CTRL-{Numpad +}

c. Previous Song = CTRL-{Numpad -}

d. Volume up/down = CTRL – Arrow up/down

e. FastForward/FastRewind = CTRL – Arrow Right/Left

f. Hide/Show playlist = F8

g. F3/Shift+F3 = Search playlist/new search

10. You can also show/hide the playlist by clicking on the folder icon on the main GUI

11. Access the options menu (very minimal settings so far) by clicking on the gear on the main GUI

12. A scrolling marquee that displays the currently playing song and other info such as the album name, track number, and artist if known.

13. A right click context menu for the playlist that allows you to edit the entries in it or delete the entry entirely. I would have liked to have had it write the ID3 tags but I couldn’t get that to work correctly, I could write them, but nothing could read them afterwards. I believe ID3.au3 UDF was corrupting the tags unless I just screwed the pooch entirely on my own.

14. A progress bar that is 100% clickable that will take you to any time in the currently playing song +/- a bit due to rounding.

15. The timer on the main GUI will show you the time remaining, or the playing time of the song. You change it by left clicking on the timer.

16. The volume control slider is accessible by the mouse scroll wheel, if you first click on it somewhere.

17. The buttons that look like fast forward/fast rewind buttons on the GUI will skip forward or backwards 10 seconds in the currently playing song.

18. There are checkboxes in the first column now that are only (at present) used when deleting files from the list. This allows you to block delete more than one file at a time now.

I have included the source for the player as well as a zip file for all the support files, including the jpgs and the non-standard UDFs in case you don’t already have them. If you want to use the UDFs you’ll need to copy them to the AutoIt3\Include folder or change the #include lines in the script accordingly. I’m sure that there are bugs in this that I haven’t encountered yet so feel free to comment. Also, I’m sure I could have scripted this better, but it’s my first big project and I was learning as I went so I threw a lot in here that probably should have been done better. I have written the script to FileInstall all of the additional files and will unpack them in the @ScriptDir[\Files] folder if you compile the script. When I compiled it, using UPX it ended up around 574Kb in size with all the files included. It's very portable due to the fact that it looks for files in the @scriptdir\Files folder and writes its .ini and saved music list in @scriptdir folder as well.

I owe a LOT of credit to the many posters on this forum for information I have read regarding things that weren’t clear to me. There are too many people to thank, and I know I’d probably miss plenty of you even if you don’t know that you helped me to get this program to this point. I tried to ask as few questions as I could so that people wouldn’t get annoyed at me, the forum search was a Godsend for me. If anyone recognizes scraps of code they wrote in here, please understand that I am not trying to plagiarize, just borrowing from those better than I am at this stuff. If I could remember where I got any non-original functions I will add that information to this posting.

#### EDIT ####

Update: I have switched from using the _Sound.au3 functions to going fully into using the BASS.au3 functions for playing all music and keeping track of song times. This will make it easier to add visualizations to the program once I figure out how to work with the BASS_SFX.au3 UDF.

#### /EDIT ####

The non-standard UDFs that I am using include Bass & BassTags by BrettF, ID3 by joeyb1275, and RecFileListToArray by Melba23.

Update 01/19/2011 Version 1.7.1

Corrected a couple of bugs in the code related to creating a new playlist.

Update 01/14/2011 Version 1.7

I have updated the files in the BMPFiles.zip archive, I had forgotten to include the files needed for the ExtMsgBox UDF, and also had forgotten that I had modified the ExtMsgBox UDF with some added functionality but had included the unmodified verison in the previous archive.

I have also corrected (I hope) the problems with a few bugs that I had introduced with the last version I uploaded for the media player file itself, and have reintroduced the previous method that I used for sorting the ListView because I think the results of the sort process works better, of course that's just my opinion. The sort method that was used in version 1.6 is still included in the code, I have just commented it out in this version, feel free to use the method you feel would work best for you.

Update: 11/15/2010 Version 1.6

I have added some new functionality to the media player. I now use some functions that I got from Melba23 that makes updating the music list a lot faster. Unfortunately it also has the side effect of messing with the nice neat sorting of the list. It will still sort by the various column headings, but the list isn't as neat as it used to be.

I have also added a search function to the music list, you can either right click the music list or press F3 to initiate a search box. Any matches, in any column, will be highlighted. Pressing F3 again will keep searching the musiclist for matches. To initiate a new search simply press Shift + F3. The search hotkey is only active when the music list ListView is the active window, I avoided using any fancy windows messages but just enabling and disabling the hotkeys by seeing if the listview is the active window.

There are also a few code fixes that were implemented to clean up the code and eliminate a few bugs that weren't major, just annoying. I've also changed the ListView's window into being an actual child window again as I didn't like the affect of changing it from a child window.

Update: 10/26/2010

Added a few help screens, replaced most of the standard MsgBox's with Melba23s Extended Message Box UDF, some bug fixes, and a lot of code optimizations to tighten up the code more. Now at version 1.4.0

BMPfiles.zip

Bobs_Media_Player_1_7_1.au3

Edited by BrewManNH

Share this post


Link to post
Share on other sites



Posted

Add skin support and some visualizations (like here made by Eukalyptus -> http://www.autoit.de/index.php?page=Thread&threadID=23204) ;)

Otherwise nice job.

Br,

UEZ

Share this post


Link to post
Share on other sites

Posted

Yeah, it's not pretty, but I was more worried about getting it to work the way I wanted rather than how good it looked. Function before form ;)

Share this post


Link to post
Share on other sites

Posted

Nice program.. using it for listening to music atm ;)

But the play/pause button is showing the wrong text.. (showing the pause button when the music is paused and play button when its playing)

Share this post


Link to post
Share on other sites

Posted

---------------------------

AutoIt3_x64.exe - No Disk

---------------------------

There is no disk in the drive. Please insert a disk into drive \Device\Harddisk6\DR6.

---------------------------

Cancel Try Again Continue

---------------------------

All I did was download the zip, extract it, then put the Bobs_media_player.au3 into the folder.. ran it.. and that error pops up non stop (have use task manager to kill it).

Win7/64bit latest autoit

Share this post


Link to post
Share on other sites

Posted

All I did was download the zip, extract it, then put the Bobs_media_player.au3 into the folder.. ran it.. and that error pops up non stop (have use task manager to kill it).

Win7/64bit latest autoit

I'm not sure why that's happening, I use it on Windows 7, but the x86 version and not 64bit, and it works fine. I don't have any experience with running AutoIt3 under a 64 bit OS so I can't be of much help in regards to that. Have you tried running it with the x86 version of Autoit3?

It could be that it's trying to read from the .ini files and that's causing a permissions issue, the .dlls might not work correctly under Win7 64bit, could be a lot of things that might be causing it. Unfortunately I don't have any machines that run a 64 bit OS so I can't test it under that scenario.

Share this post


Link to post
Share on other sites

Posted

Nice program.. using it for listening to music atm ;)

But the play/pause button is showing the wrong text.. (showing the pause button when the music is paused and play button when its playing)

That's what it's supposed to show. When the music is paused it gives you a visual indication that it's paused, click it again, and it shows you that it's playing. If you prefer it the other way around, look in the play() function, and at lines 329 and 332 reverse the ";" and "4" in those lines and it will show you the button the other way around.

Share this post


Link to post
Share on other sites

Posted

I'm not sure why that's happening, I use it on Windows 7, but the x86 version and not 64bit, and it works fine. I don't have any experience with running AutoIt3 under a 64 bit OS so I can't be of much help in regards to that. Have you tried running it with the x86 version of Autoit3?

It could be that it's trying to read from the .ini files and that's causing a permissions issue, the .dlls might not work correctly under Win7 64bit, could be a lot of things that might be causing it. Unfortunately I don't have any machines that run a 64 bit OS so I can't test it under that scenario.

I figured it out.. it has to do with the FileInstall lines... seeing as I have no G drive it causes some issues. I just commented those all out (seeing as the file was already right where all the includes were) and it worked fine. It's a pretty good start. However, there's lots that can be done to make it more functional..

Share this post


Link to post
Share on other sites

Posted

I figured it out.. it has to do with the FileInstall lines... seeing as I have no G drive it causes some issues. I just commented those all out (seeing as the file was already right where all the includes were) and it worked fine. It's a pretty good start. However, there's lots that can be done to make it more functional..

The only time that the FileInstall lines should be called are when you compile it, if you don't compile it, you don't need to comment them out, just change them to where ever the script is and where it's support files are located. Shouldn't be hard to fix that.

As to the more functionality, what were you thinking?

Share this post


Link to post
Share on other sites

Posted (edited)

The only time that the FileInstall lines should be called are when you compile it, if you don't compile it, you don't need to comment them out, just change them to where ever the script is and where it's support files are located. Shouldn't be hard to fix that.

As to the more functionality, what were you thinking?

When it's not compiled FileInstall acts as pretty much a FileCopy command.. check the helpfile for more info on that.

As for suggestions, these are all just my opinions on what would make your program look more professional and operate more functionally..

  • Take the "error" out of the "Do you want to create a music library?" Your asking a question, it's not really an error at all.. I'm used to seeing that x and expecting that my program has crashed
  • Your main GUI wastes lot of open space, I personally think GUI's shouldn't have lots of blank useless space
  • Instead of a progressbar for the song progress, let the user use a seek bar, what you have now is kind of cool, but seek bars are definitely more functional for this
  • Right clicked the playlist listview and clicking edit crashes the program for me (at least when the list is blank)
  • This next one is really tricky, I had a media player once and it took me forever to figure out how.. but instead of having an extra almost hidden column for the full file name.. use an array, look at the _GUICtrlListView_MapIDtoIndex and MapIDtoIndex
  • Having a pretty listview isn't worth having to completely redraw it whenever you delete an item
  • In the title column of your listview, trim out the.mp3.. the user doesn't care (or at least I never do)
  • I think it's kind of weird that the "Playlist" window is always on top of the other window.. (try dragging one below the other to see what I mean)
  • Your seek/timer update freezes if you click on a menu item.. to fix this you can use AdLibRegister and put everything in you main While loop (or most of it) into the function..
  • One thing I don't like in random play is that occasionally it will repeat the same song right after it's just been played..
  • First time I exited the msgbox disappeared before I could answer.. Plus, I would just automatically save window positions.. also column widths
  • Load a song list is weird.. first of all because it doesn't let you select a song list.. secondly it doesn't seem to make the listview pretty like what happens when you select add song to library
  • Last thing I'll mention is that this isn't recognizing any of my media data (no track#, no album no artist..).. I'm not really sure why
Edited by Achilles

Share this post


Link to post
Share on other sites

Posted

When it's not compiled FileInstall acts as pretty much a FileCopy command.. check the helpfile for more info on that.

As for suggestions, these are all just my opinions on what would make your program look more professional and operate more functionally..

[*]Take the "error" out of the "Do you want to create a music library?" Your asking a question, it's not really an error at all.. I'm used to seeing that x and expecting that my program has crashed

[*]Your main GUI wastes lot of open space, I personally think GUI's shouldn't have lots of blank useless space

[*]Instead of a progressbar for the song progress, let the user use a seek bar, what you have now is kind of cool, but seek bars are definitely more functional for this

I had forgotten that about the FileInstall functions, thanks for reminding me. ;) Minor glitch that can be easily fixed, it can probably be changed to not using a drive letter and using the relative folder that it's in in its place. But I've used it on computers with no G:\ drive and I haven't seen that problem so I'm not sure why it affects your system.

As to the wasted space, as I stated above, I was after functionality before form. I don't care so much how it looks as how it works. After all, how often are you staring at your media player? I may revisit the looks of it sometime in the future, but for now I will focus on making sure I haven't created too many bugs.

BTW, it has a seek bar, the progress bar is clickable so that it will take you to any point in the song, +/- a bit due to rounding that doesn't affect much. Unless that's not what you meant, if not please elaborate.

[*]Right clicked the playlist listview and clicking edit crashes the program for me (at least when the list is blank)

Will look at at that.

[*]This next one is really tricky, I had a media player once and it took me forever to figure out how.. but instead of having an extra almost hidden column for the full file name.. use an array, look at the _GUICtrlListView_MapIDtoIndex and MapIDtoIndex

[*]Having a pretty listview isn't worth having to completely redraw it whenever you delete an item

I don't see the need for removing that column. The hidden/shrunken column works for me in that if I need to edit a song in the list, the location that it's in usually gives me clues as to what to put into the other columns. Having that column still in my listview window facilitates that process.

The purpose of redrawing the listview has nothing to do with recoloring it, it's a byproduct of the RebuildLV() functionality. If you delete an item in a list view, the Next and Previous buttons will fail to operate correctly. It's the same if you sort your list, once you sort/resort it, your indexes are all over the place. If I don't rebuild the LV every time, the main functions of the player stop working correctly, mainly playing the next song when the previous song finishes. I'm very proud of this functionality because I have never seen a media player that includes sorting or editing that does it correctly. It took me quite some time to figure it out.

[*]In the title column of your listview, trim out the.mp3.. the user doesn't care (or at least I never do)

Will look into that.

[*]I think it's kind of weird that the "Playlist" window is always on top of the other window.. (try dragging one below the other to see what I mean)

[*]Your seek/timer update freezes if you click on a menu item.. to fix this you can use AdLibRegister and put everything in you main While loop (or most of it) into the function..

The playlist window is a child window, I did it this way specifically so that it wouldn't spawn another taskbar item just because the song list is open.

I do use AdlibRegister for the timer. It has no effect on whether it gets updated or not, the same thing will happen if you click the title bar and move the window, there are methods that I've seen that will help with that but it's a minor quibble either way so it wasn't worth the extra effort because it will self-correct itself after you let go of the title bar or the menu items.

[*]One thing I don't like in random play is that occasionally it will repeat the same song right after it's just been played..

Not something I'm going to change, it would entail keeping track of what's been played and what hasn't and, to me, it isn't worth the tons of coding needed at this point. Plus I have over 3500 songs myself, and that would mean a very large array, which would increase the memory needed, I'm trying to keep it as svelte as possible.

[*]First time I exited the msgbox disappeared before I could answer.. Plus, I would just automatically save window positions.. also column widths

The box disappeared because I set it to time out after a period of time, because of all the testing I was doing. I forgot to remove the timeout on the exit message, easy fix for anyone that wants to. Will be in the next update, but for now, just change the MsgBox timeout.

As to automatically saving the windows positions, that's not an option for a player that is supposed to be portable between computers. The reason I ask in the options is so that if you truly do use it on more than one computer then if for example, you have moved a window to a second monitor on one computer and you use it on a computer that only has one monitor, the other window may get lost. I try to autocorrect for that when reading the information from the ini file, but this is for those users that don't want them saved. Also the columns are autosized according to the length of the items in them, saving the column width wouldn't do anything because they'll get resized everytime I use the RebuildLV() function.

[*]Load a song list is weird.. first of all because it doesn't let you select a song list.. secondly it doesn't seem to make the listview pretty like what happens when you select add song to library

The player is by design, only set up to import a music list with a specific name, so that's why it will not give you the option to load in a different file. I will look into implementing asking for a file list, probably be in the next update as well. It shouldn't be too hard to implement.

[*]Last thing I'll mention is that this isn't recognizing any of my media data (no track#, no album no artist..).. I'm not really sure why

I don't have any control over the basstags.dll, I just use the information that it hands me. I am going to add in the functionality of looking at file information that windows knows about a file to see if I can grab from it any information that basstags doesn't get. But if Windows doesn't show any information about your files either, it's still not going to help in your situtation. I had the same problems when I tried to add writing to tags in a file with ID3.au3, the tags were getting corrupted so that I couldn't read them back with any program I tried which is why editing a song in the LV won't write the info to the tags in the song file. I had to repair all the tags that I had edited just so that I could see them in my program again. Wasn't worth the effort to to try and correct that problem, because there are a million tag editing programs out there.

Share this post


Link to post
Share on other sites

Posted

I have updated the source code in the first post to correct some bugs, and also added a few new features.

  • Added the ability to select a file to save your music list to. It no longer only reads from and write to Musiclist.txt
  • More idiot-proofing code added
  • Changed the way that the ini file is written to when closing the program, if you choose to not save the windows positions, it now deletes the entries for the windows locations. Previously it just didn't update them, now it proactively deletes them the way I had originally intended.
  • The fileinstall commands at the begining of the program now use relative paths for the files instead of a specific path, this should elminate some issues.
  • If you don't have a music list file saved the message box now uses the "?" icon instead of the error one.
  • I changed the way that file properties are loaded, it will first look for the ID3 tags, and if nothing is found will attempt to look at the File Properties that Windows knows about the file, and if that fails, will drop back to the "Unknown xx" that I used before.
  • The message box that asks if you want to save the window positions now won't time out, you have to click the button to close it.
I hope you find it more user friendly, and if you see anything that needs to be fixed, or if you have suggestions, please let me know. Thanks for downloading.

Share this post


Link to post
Share on other sites

Posted (edited)

I have updated the source file in the first post to correct some minor typos and fixed a couple of small bugs.

  • Now it properly updates the music list when opening a saved library file
  • I have improved the looks of the scrolling marquee by adding a small blank label above it, previously the text was appearing to touch to top of the marquee bar, now it appears more in the middle of it.
  • I have increased the size of the timer display and moved it to a more central location.
  • I corrected an error when trying to read the file properties for the Album Title, Windows 7/Vista use the tag "Album" where XP uses "Album Title" and I was only looking for "Album" in the search which resulted in a lot of Unknown Album tags in the listings that shouldn't have been there.
  • Added pseudo splash screens when reading the saved music list and when rebuilding the ListView so that you won't see the behind the scenes deleting/adding of items, plus it lets you know that it hasn't frozen it's just doing something else.
  • More error checking code added to prevent some things that I should have been checking for in the first place.

Some things I'm thinking of adding are:

  • Adding a search function, just not sure how to implement it in the GUI I have now.
  • Adding the ability to delete more than one listing at a time, rather than the way it is now where you have to do it individually. Which takes forever if you have a lot of song files, because I have to rebuild the ListView table every time one gets deleted. Another thing that I have to figure out how to implement.
  • Once I get this all working as I hope, I will start improving the look and feel of the GUI, skinning and/or visualizations to be added at some point.
  • I would like to revisit adding in tag updating for the files, but it's low on the priority list at the moment due to not having found a reliable tag editing UDF and lacking the time/expertise to create one myself at this point in time.

EDIT ++++

I inadvertently uploaded the source file with some typos in 2 #include lines, they had a space in the names that shouldn't have been there, not really sure how they got changed like that, but I have uploaded a corrected version so that those spaces are removed. Sorry to anyone that might have gotten the last version. This one should work ok.

Edited by BrewManNH

Share this post


Link to post
Share on other sites

Posted

Hello, people. (my name is - com_1)

I compiled (create) this program for yourself, maybe you'll need too, enjoy.

http://ul.to/a34z4j

Posted Image

Share this post


Link to post
Share on other sites

Posted

Wtf ? xD

Share this post


Link to post
Share on other sites

Posted

I have update the source file in the first post. It's now at version 1.3.2

Changelog for this version is:

1] I added checkboxes to the first column of the listview that are used when deleting files from the list. I plan on adding more functionality to them later, but for now, they just work when deleting. They allow you to select all the files that you want to delete with the checkboxes, then right click anywhere on the listview and select delete, they will all be deleted at the same time. I have also retained the functionality of right clicking a single item in the listview and deleting that, but be careful with this, because if you have any checkboxes checked, those will get deleted instead.

2] I have made it even more portable between computers now. If the songs you're adding are on the same drive as the script is run from, it will not include the drive letter of the song files when adding them to the list. This allows you to put the script on an external drive that also holds your song collection. If you use the program on a different computer, you won't have to rebuild the list just because the external drive gets a new drive letter.

3] If you do anything that requires the listview to be rebuilt, such as deleting items, editing items, adding songs etc. The currently playing song will be stopped. Previously the song would continue to play which caused issues due to trying to pause it, stop it, or going to the next/previous song after the rebuilding was done. Now that issue has been eliminated in the only way possible to ensure the functions work correctly after.

Share this post


Link to post
Share on other sites

Posted

Another update, now at version 1.3.3

Changelog

1) I have added the currently playing song artist and title in the window title so that when you hover over the taskbar button for the player, you can see what's playing.

2) Fixed a bug where if you are asked to save your song list when closing the program, if there was an error saving the list, it would just exit. Now it allows you to retry saving it. Because the program reads the location of the musiclist file from its INI file, if you move the program to a computer that doesn't have the same drive letters, it might not save the list at all. Now you are given the chance to try and save it in a different location.

Share this post


Link to post
Share on other sites

Posted

Major update to my media player.

I have switched from using the _sound.au3 functions to using the BASS functions to play the music. This allows me to add in FLAC, AIFF, and OGG files as supported files that can be played with the media player. I have also added in options in the Options menu (click on the gear icon on the main GUI) that allows you to choose which file types that you want to search for when adding music to the listing. Using the BASS functions, also allows me to eventually add in visualization support once I figure out the BASS_SFX functions.

I have also updated the ZIP file with the support files in it due to this change. If you have previously downloaded the BMPFiles.zip file, and you wish to check out the changes in this update, you will need to download the newest zip file.

Share this post


Link to post
Share on other sites

Posted (edited)

Another update to this media player. I have added a help menu with a Help screen, Copyright notice, FAQ and credits screens. Some of you might be interested in the technique used to create the hyperlinks in the credit screens, as well as the method used in the Help screens. Nothing new here, but I think a pretty cool way about it. Also, I have changed the Play/Pause button icon so that when the song is playing it shows a Pause icon, and when stopped or Paused it shows the Play icon it really does look better that way than how I had it before (thanks to Kiesp for suggesting it).

Also, I have updated most of the informational and error message boxes. I am now using Melba23s excellent Extended Message Box UDF to make them better looking than the average generic message boxes.

I have also changed the location that the support files get saved to when it's run, it now creates a Files menu under the @ScriptDir folder and places everything in there except for the .exe, the bmp.ini, and the library files. It makes for a cleaner folder when it's done this way, this way only the 3 files (by default) are placed in the folder that the program resides, and everything else is elsewhere.

By the way, in case it wasn't obvious, the program will run if the image files are missing from your drive, it just won't look as good. It DOES require the .dll files though, so make sure you don't delete them if you haven't downloaded the BASS UDF. The BASSWMA.DLL isn't included in the BASS download, but I have included it in the support files posted in the first post.

There have also been some minor bug fixes that I discovered. I have also done some more code optimizations, so it doesn't look as tossed together as it used to. If you have a large media collection, the memory usage of the program will be quite high the first time you create your library. Once the musiclist has been saved, and you rerun the script, the program's memory footprint is nice and small, with low CPU usage as well.

This program still needs a few features that I would like to add one of these days, but unfortunately my time is much more limited than I had hoped, so things progress slowly.

I don't know if anyone is actually using this program or not, but I'm still working on it as much as I can, especially as I learn new ways of dealing with old ideas. Any feedback would be appreciated, even if you just want to say how much you hate it, and how ugly it is. ;)

Edited by BrewManNH

Share this post


Link to post
Share on other sites

Posted

I have updated the source code again for the media player, see the notes in the first post for the updates for this version. Version is now 1.6, also I realized that I had inadvertantly deleted the support files so I have uploaded them again as well as the source code update.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.