INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Python Interface ideas...  (Read 531 times)

Striker

  • World Citizen
  • ***
  • Posts: 176
Python Interface ideas...
« on: September 06, 2020, 03:14:48 pm »

I know it's early in the v27 development cycle...  I want to share some ideas and get opinions and additions from others.  We all use MC differently...

I would like to see some kind of scheduler with triggers for executing a Python script.  I would like all python scripts to have access to data about the currently playing track and the upcoming track, or maybe some array with X number of upcoming track info objects.

Triggers could be:

start mediacenter
end mediacenter
start playback
end playback
pause
unpause
change track
date/time
etc, etc ...

Right now I use the old "PlayingNow" plugin to simply execute a script on track change and to write out a file with details on the current and next track.

If there was a way to trigger a python script on track status change, I could give up the 32 bit version of MC for the 64 bit version and give up the "PlayingNow" plugin.

For example, I have "PlayingNow" configured to write out a file (example below) and then call a C++ program I wrote to read and display the info from the file on screens around my house.  I could easily see replacing all of this with a python script I can write, triggered on track change.

Quote
[PLAYING_NOW]
DURATION="9:55"
TRACK="1"
ARTIST="Manfred Mann's Earth Band"
ALBUM="1972 Solar Fire"
SONG="Father of Day, Father of Night"
PLAYCOUNT="31"
GENRE="Rock"
GENRE_ALL=" Rock "
YEAR="1972"
NEXT_ARTIST=" Manfred Mann's Earth Band "
NEXT_ALBUM=" 1972 Solar Fire "
NEXT_SONG=" In The Beginning, Pluto "
NEXT_RATING=" 4 "
RATING="5"
LASTPLAYED="2020-05-11 13:08"
DATEIMPORTED=" 2006-07-01 08:35 "
SOURCE="flac"
FILETYPE=" flac "
[END]

Another thought would be to replace/supplement the MC27.exe program with a MediaCenter python library to execute the same things MC27.exe can do now... with easier feedback and the ability to send multiple commands to MC in a single script instead of having to call MC27.exe multiple times from a batch file.

Thoughts?
Logged
Pages: [1]   Go Up