I have a media player I’ve created in C, and its running along side a server I have in Python. The server accepts commands to modify a play list that resides in an SQLite database.
Once the python code updates the DB (This happens in the background while the media player is playing) it needs to let the player know a new playlist is in the DB so it can start playing the new files.
I was going to set a flag in the DB, and the player can constantly poll this flag, but I don’t think this is the best way. All the options I can think of involve the media player constantly checking for something.
What would be the best way of going about this?
There are many ways you can do that:
mkfifoon Linux machines. Files created that way works similar to sockets.I would recommend UDP sockets. It’s easy, fast and more elegant than signals. Python code would be something about 3 lines of code.
Example Python code:
Example C UDP server:
http://www.cs.ucsb.edu/~almeroth/classes/W01.176B/hw2/examples/udp-server.c