Kara-Moon Forum
March 29, 2024, 12:49:16 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Command line options for the MIDI player  (Read 5605 times)
sciurius
Sr. Member
****
Posts: 443



« on: August 18, 2013, 08:08:31 PM »

According to the docs, the SetMIDIPlayer command can be used to set the desired MIDI player. Also:

Code:
It is permissible to include command options as well. So, for example, on Linux you might do:
SetMIDIplayer timidity -a

This works, but this does not:

Code:
SetMIDIplayer timidity -a -U

In general, one single option works, anything else is passed to player as a single, space concatenated argument.

Fix:
Code:
*** MMA/player.py~      2012-12-29 00:07:50.000000000 +0100
--- MMA/player.py       2013-08-18 22:07:50.412426773 +0200
***************
*** 107,113 ****
   
      cmd = [pl]
      if opts:
!         cmd.append(' '.join(opts))
      cmd.append(file)
 
      t=time.time()
--- 107,113 ----
   
      cmd = [pl]
      if opts:
!         cmd.extend(opts)
      cmd.append(file)
 
      t=time.time()
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #1 on: August 18, 2013, 08:45:19 PM »

Darn! I spent hours working on this bit of code to get it work on windows and linux. You are correct, of course ... can you test your change on a windows box to see if that works there as well. Might have to wrap it otherwise depending on the platform.

Thanks for catching this!
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #2 on: August 19, 2013, 05:48:39 AM »

can you test your change on a windows box to see if that works there as well.

Sorry, I don't have Windows boxes.
I'm quite confident that on Windows the command line gets joined and split again anyway, so at most it will not do any harm.
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #3 on: August 19, 2013, 04:23:55 PM »

And, further if my memory serves, the way mma sets it up with no program name or options is just fine for windows since it accepts a default midi program from the system level (file association). So, your fix is committed ... and you get a free upgrade Smiley

Thanks.
Logged

My online life: http://www.mellowood.ca
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.046 seconds with 19 queries.