photools.com Community

IMatch Discussion Boards => IMatch Scripting and Apps => Topic started by: Jingo on August 05, 2017, 10:45:42 PM

Title: APP REQUEST: Music Player **CODED**
Post by: Jingo on August 05, 2017, 10:45:42 PM
A request was made to allow music files to play inside IMatch.  Though this can be easily done via the preview window - I figured I would make an App just for the fun of it.  So.. without further Ado... I present to you.. the Music Player App:

(https://vgy.me/dAuptH.png)    (https://vgy.me/uVTQZc.png)

The Music player app will allow you play certain music files directly in an APP.  There are a few restrictions - MP3 files currently are NOT supported in the Chromium browser and thus will not play within the APP.  If you load the APP in your browser window, it should run fine (it does for me in Firefox).  I coded video support but also ran into issues with the files not playing in the App Panel... but some formats played fine in the browser while others didn't.  In the end, I just removed support for video files though the code is still in place in case someone wishes to try and get this working (a simple extension check would need to be removed along with uncommenting the video HTML control).

When you click on a file in IMatch, an enrty is added to the playlist if it is one of the valid audio types.  Clicking the link will start the audio playing... simple.

Future ideas to be implemented:
  Saving/Loading playlists for future retreival
  Loading a Group of files (selection) rather than choosing them one by one
  Visualizations

Please let me know your thoughts.... again - its not great... but seems to work and provides another example of what can be done in IMatch via JS... and perhaps the code will prove useful in your own apps too!

Enjoy - Andy.

Title: Re: APP REQUEST: Music Player **CODED**
Post by: Mario on August 06, 2017, 08:53:05 AM
A good start. Thanks for sharing.

Chromium will add MP3 support at some point in the future, I'm sure.
The code is already there, it's just not enabled by default.
I use a binary distribution of Chromium and don't compile it myself (this would be a research project because the tooling is massive and the build process requires Gigabytes of files and tons of settings) but if I did I could enable MP3 support. I would need first need to consult a lawyer, though, because MP3 is a legal minefield...same as MPEG.

Spotfy and the Amazon Music Player are written in JavaScript and then wrapped in Electron to make them 'real' applications. Lots can be done with JavaScript  ;)
Title: Re: APP REQUEST: Music Player **CODED**
Post by: Jingo on August 06, 2017, 02:36:11 PM
Thx Mario... its a very "bare" app at the moment but at least it works!  Will be adding additional support and making it look better when I have some time... 

I'll take a peek at these other wrappers... I know there are tons of libraries and now that I have this working properly - it might make sense to take a look at them to see what they can offer.

EnjoY!!
Title: Re: APP REQUEST: Music Player **CODED**
Post by: Aubrey on August 06, 2017, 03:58:18 PM
OK, now how do I install?
I've looked in the documentation nothing on installation...

I've put the "music player" folder in

C:\ProgramData\photools.com\imatch6\plugins

But not sure what else.

There must be something in the manual but I can't find it.

Aubrey.
Title: Re: APP REQUEST: Music Player **CODED**
Post by: sinus on August 06, 2017, 08:02:08 PM
Aubrey, not in the plugins, but in this folder:

C:\ProgramData\photools.com\imatch6\webroot\user
Title: Re: APP REQUEST: Music Player **CODED**
Post by: Menace on August 06, 2017, 09:01:00 PM
Great work. Thank you for sharing.

Would it be possible to repeat inside a song (A -> B) and would it be possible to slow down music?

Title: Re: APP REQUEST: Music Player **CODED**
Post by: sinus on August 06, 2017, 09:10:01 PM
Quote from: Menace on August 06, 2017, 09:01:00 PM
Great work. Thank you for sharing.

Thanks also for a cool work!  :)
Title: Re: APP REQUEST: Music Player **CODED**
Post by: Jingo on August 06, 2017, 10:19:46 PM
Sorry Aubrey - forgot the installation notes.  As Markus mentioned, all apps go in the: C:\ProgramData\photools.com\imatch6\webroot\user   folder... so any app can be just dumped in a subfolder and the app manager will automatically read the json file within and include the app.

Hi Menace.. glad you like it!  The native audio DOM does not allow for "trimming" within the song... but I can add controls to determine the playback speed... working on that now.  To try and support MP3 ahead of Chrome... I'm going to look at few other libraries... they might have editing options which would allow me to offer this as well.

Enjoy all!

Title: Re: APP REQUEST: Music Player **CODED**
Post by: Jingo on August 06, 2017, 10:53:52 PM
Ok.. here is an updated version that adds some speed buttons to the app... will make it more elegant down the road... Enjoy!

(https://vgy.me/roNZRE.png)
Title: Re: APP REQUEST: Music Player **CODED**
Post by: sinus on August 07, 2017, 08:40:16 AM
Hi Andy

Thanks for this, really nice and useful!

If you want more work  ;)

- A button to clear the playlist or even delete some entries
- The entries does quite use some lines, maybe better not that long entrys (only the name?) (see attachement)
- An image would be nice (Mario had this in his old script, gone)

Anyway, thanks for that!

@Menace
Since you must be a music-expert (music was always important for you here on the forum), sorry for a stupid question:
For what is slow-down music interesting (or speed up)?
Title: Re: APP REQUEST: Music Player **CODED**
Post by: Menace on August 07, 2017, 03:59:47 PM
Quote from: sinus on August 07, 2017, 08:40:16 AM
@Menace
Since you must be a music-expert (music was always important for you here on the forum), sorry for a stupid question:
For what is slow-down music interesting (or speed up)?

No expert, please.  :)
I play a little bit guitar, bass and drums. But the songs, I want to play with, a mostly to fast for playing with. I have special software (Transcribe! is a great tool). But sometimes it would be nice just to start a song from IMatch directly and slow down about 50%, 70%, 80%, 90%, 95% and 105% - 115%.  :)
Title: Re: APP REQUEST: Music Player **CODED**
Post by: sinus on August 07, 2017, 04:59:07 PM
Quote from: Menace on August 07, 2017, 03:59:47 PM
Quote from: sinus on August 07, 2017, 08:40:16 AM
@Menace
Since you must be a music-expert (music was always important for you here on the forum), sorry for a stupid question:
For what is slow-down music interesting (or speed up)?

No expert, please.  :)
I play a little bit guitar, bass and drums. But the songs, I want to play with, a mostly to fast for playing with. I have special software (Transcribe! is a great tool). But sometimes it would be nice just to start a song from IMatch directly and slow down about 50%, 70%, 80%, 90%, 95% and 105% - 115%.  :)

I see, thanks, hmmm, a little bit gutar = 50% + a little bit bass = 75% + a little bit drums = 100%  ;D ;D ;)