User:Bulek

From LinuxMCE
Revision as of 10:05, 18 June 2008 by Bulek (Talk | contribs) (New page: Power #193 Off SendMultiZoneCommand(cmd, ["@PWR:1", "@MSP:1", "@MAM:2"]) #SendMultiZoneCommand(cmd, ["@AMT:2", "@MSP:1", "@MAM:2"]) #192 On SendMultiZoneCommand(cmd, ["@PWR:2", "@MSP:...)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Power

  1. 193 Off

SendMultiZoneCommand(cmd, ["@PWR:1", "@MSP:1", "@MAM:2"]) #SendMultiZoneCommand(cmd, ["@AMT:2", "@MSP:1", "@MAM:2"])

  1. 192 On

SendMultiZoneCommand(cmd, ["@PWR:2", "@MSP:2", "@MAM:1"]) #SendMultiZoneCommand(cmd, ["@AMT:1", "@MSP:2", "@MAM:1"])

Inputs

  1. 169 AM

SendMultiZoneCommand(cmd, ["@SRC:H", "@MSC:H", "@MSC:H"])

  1. 164 Aux

SendMultiZoneCommand(cmd, ["@SRC:9", "@MSC:9", "@MSC:9"])

  1. 172 Aux 2

SendMultiZoneCommand(cmd, ["@SRC:A", "@MSC:A", "@MSC:A"])

  1. 162 CD

SendMultiZoneCommand(cmd, ["@SRC:C", "@MSC:C", "@MSC:C"])

  1. 420 CDR

SendMultiZoneCommand(cmd, ["@SRC:D", "@MSC:D", "@MSC:D"])

  1. 178 DSS

SendMultiZoneCommand(cmd, ["@SRC:4", "@MSC:4", "@MSC:4"])

  1. 165 DVD

SendMultiZoneCommand(cmd, ["@SRC:2", "@MSC:2", "@MSC:2"])

  1. 170 FM

SendMultiZoneCommand(cmd, ["@SRC:G", "@MSC:G", "@MSC:G"])

  1. 160 Tape / Tape 1

SendMultiZoneCommand(cmd, ["@SRC:E", "@MSC:E", "@MSC:E"])

  1. 166 Tuner

SendMultiZoneCommand(cmd, ["@SRC:F", "@MSC:F", "@MSC:F"])

  1. 161 TV

SendMultiZoneCommand(cmd, ["@SRC:1", "@MSC:1", "@MSC:1"])

  1. 282 VCR-1

SendMultiZoneCommand(cmd, ["@SRC:3", "@MSC:3", "@MSC:3"])

DSP Modes (Audio)

  1. 891 All Ch Stereo

#<$"@SUR:0H\r"$> SendIrCommand("@SUR:0H")

Disk Handle

  1. 48 Eject Disk


General

  1. 190 Enter/Go


Internal

  1. 373 Private Method Listing

def ReceiveReportCommand() buff = conn_.RecvDelimited("\r", 1000) print "Cmd response from Marantz: " + buff + "\n" log("Cmd response from Marantz: " + buff + "\n") end def SendIrCommand(command) conn_.Send(command+ "\r") log("Sending Command: " + command + "\n") ReceiveReportCommand() end def log(word) logTime = Time.now timeStr = logTime.strftime("%d-%m-%Y %H:%M:%S ") print( timeStr + " " + word) if( $logFile.nil? == false ) then $logFile.print( timeStr + " " + word ) $logFile.flush() end end def SendMultiZoneCommand(cmd, commandsArray, commandParam="") log("Got Command with ID: " + cmd.id_.to_s + " from: " + cmd.devidfrom_.to_s + " to: " + cmd.devidto_.to_s + "\n") zone = GetZone(cmd.devidto_) if( zone >= 0 and zone < commandsArray.size ) log("Determine zone for command : " + zone.to_s + "\n") SendIrCommand(commandsArray[zone] + commandParam.to_s) else log("SendMultiZoneCommand: invalid zone " + zone.to_s) end end def GetZone(deviceDestination) if( device_.mapDevice_PortChannel_.has_key?(deviceDestination) and device_.mapDevice_PortChannel_[deviceDestination] != nil and !device_.mapDevice_PortChannel_[deviceDestination].empty? ) return device_.mapDevice_PortChannel_[deviceDestination].to_i end return 0 end def ShowZones() log("####### Dev 2 PortChanel") device_.mapDevice_PortChannel_.each do |key, value| log(key.to_s + " => " + value.to_s) end log("======= PortChanel 2 Dev") device_.mapPortChannel_Device_.each do |key, value| log(key.to_s + " => " + value.to_s) end end

  1. 351 Process IDLE


  1. 350 Process Incoming Data

buff = conn_.RecvDelimited("\r", 1000) print "Info from Marantz: " + buff + "\n" log("Info from Marantz: " + buff + "\n")

  1. 355 Process Initialize

$logFile = File.new("/var/log/pluto/Marantz_SR5600.log", "w") log("Initializing Marantz GSD Device\n") #<$"@AST:F\r"$> # max level of feedback SendIrCommand("@AST:F") #<$"@MPW:2\r"$> # multi room always on SendIrCommand("@MPW:2") #<$"@MSP:1\r"$> # turn multi room speakers off by default SendIrCommand("@MSP:1") #<$"@MAM:2\r"$> # mute multi room line out by default SendIrCommand("MAM:2") #<$"@VOL:0-20\r"$> # default main volume -20 SendIrCommand("@VOL:0-20") #<$"@MSV:0-60\r"$> # default multi speaker volume SendIrCommand("@MSV:0-60") #<$"@MVL:0-60\r"$> # default multi room line out volume SendIrCommand("@MVL:0-60") log("Initialization of Marantz GSD Device finished !!!!\n")

  1. 384 Process Receive Command For Child


  1. 356 Process Release

log("Shutting down Marantz GSD Device\n") SendIrCommand("@MAM:2") SendIrCommand("@MSP:1") log("Sending Marantz : Power Off: PWR:1\n") #<$"@PWR:1\r"</s></s>$> SendIrCommand("@PWR:1")

Misc

  1. 587 Preset/Prog/Freq

identifier = cmd.params_[216] # Main volume "TFQ:0xxxxx" from 08700 till + 10800 # Multiroom Frequency “MTF:0xxxxx“ from 08700 till + 10800 # Multiroom Speakers “MTF:0xxxxx“ from 08700 till + 10800 # switch to tuner mode first SendMultiZoneCommand(cmd, ["@SRC:G", "@MSC:G", "@MSC:G"]) # tune to desired frequency SendMultiZoneCommand(cmd, ["@TFQ:0"+identifier, "@MTF:0"+identifier, "@MTF:0"+identifier]) log("Sending Marantz : Setting tuner frequency to "+identifier+"\n")

On-Screen Menu Navig

  1. 240 Back / Prior Menu


  1. 225 Display


  1. 368 Help


  1. 86 Menu (Show Menu)


  1. 201 Move Down


  1. 202 Move Left


  1. 203 Move Right


  1. 200 Move Up


Simple Control

  1. 92 Pause


  1. 139 Play


  1. 102 Record


  1. 64 Skip Back - Channel/Track Lower


  1. 63 Skip Fwd - Channel/Track Greater


  1. 95 Stop


Sound & Volume

  1. 97 Mute

SendMultiZoneCommand(cmd, ["@AMT:0", "@MSM:0", "@MAM:0"])

  1. 313 Set Volume

level = cmd.params_[76] # Main volume “VOL:0xxx” from - 99 till + 18 # Multiroom Speakers "MSV:0xxx" from - 99 till + 0 # Multiroom Speakers “MVL:0xxx” from - 99 till + 0 SendMultiZoneCommand(cmd, ["@VOL:0"+level, "@MSV:0"+level, "@MVL:0"+level]) log("Sending Marantz : Set Volume Level to "+level+"\n")

  1. 90 Vol Down

SendMultiZoneCommand(cmd, ["@VOL:2", "@MSV:2", "@MVL:2"])

  1. 89 Vol Up

SendMultiZoneCommand(cmd, ["@VOL:1", "@MSV:1", "@MVL:1"])

Speed Ctrl

  1. 125 Scan Back/Rewind


  1. 93 Scan Fwd/Fast Fwd


  1. 98 Slow Scan Back


  1. 99 Slow Scan Forward


DSP ModesDSP Mode commands not implemented: Dolby Digital, DTS Surround, Surround (Click to add)


def ReceiveReportCommand() buff = conn_.RecvDelimited("\r", 1000) print "Cmd response from Marantz: " + buff + "\n" log("Cmd response from Marantz: " + buff + "\n") end

def SendIrCommand(command) conn_.Send(command+ "\r")

       log("Sending Command: " + command + "\n")

ReceiveReportCommand() end

def log(word) logTime = Time.now timeStr = logTime.strftime("%d-%m-%Y  %H:%M:%S ")

print( timeStr + " " + word) if( $logFile.nil? == false ) then $logFile.print( timeStr + " " + word ) $logFile.flush() end end

def SendMultiZoneCommand(cmd, commandsArray, commandParam="")

       log("Got Command with ID: " + cmd.id_.to_s + " from: " + cmd.devidfrom_.to_s + " to: " + cmd.devidto_.to_s + "\n")

zone = GetZone(cmd.devidto_) if( zone >= 0 and zone < commandsArray.size ) log("Determine zone for command : " + zone.to_s + "\n") SendIrCommand(commandsArray[zone] + commandParam.to_s) else log("SendMultiZoneCommand: invalid zone " + zone.to_s) end end

def GetZone(deviceDestination) if( device_.mapDevice_PortChannel_.has_key?(deviceDestination) and device_.mapDevice_PortChannel_[deviceDestination] != nil and !device_.mapDevice_PortChannel_[deviceDestination].empty? ) return device_.mapDevice_PortChannel_[deviceDestination].to_i end

return 0 end

def ShowZones() log("####### Dev 2 PortChanel") device_.mapDevice_PortChannel_.each do |key, value| log(key.to_s + " => " + value.to_s) end

log("======= PortChanel 2 Dev") device_.mapPortChannel_Device_.each do |key, value| log(key.to_s + " => " + value.to_s) end end


buff = conn_.RecvDelimited("\r", 1000) print "Info from Marantz: " + buff + "\n" log("Info from Marantz: " + buff + "\n")


$logFile = File.new("/var/log/pluto/Marantz_SR5600.log", "w") log("Initializing Marantz GSD Device\n")


  1. <$"@AST:F\r"$> # max level of feedback

SendIrCommand("@AST:F")


  1. <$"@MPW:2\r"$> # multi room always on

SendIrCommand("@MPW:2")

  1. <$"@MSP:1\r"$> # turn multi room speakers off by default

SendIrCommand("@MSP:1")

  1. <$"@MAM:2\r"$> # mute multi room line out by default

SendIrCommand("MAM:2")

  1. <$"@VOL:0-20\r"$> # default main volume -20

SendIrCommand("@VOL:0-20")

  1. <$"@MSV:0-60\r"$> # default multi speaker volume

SendIrCommand("@MSV:0-60")

  1. <$"@MVL:0-60\r"$> # default multi room line out volume

SendIrCommand("@MVL:0-60")

log("Initialization of Marantz GSD Device finished !!!!\n")



log("Shutting down Marantz GSD Device\n") SendIrCommand("@MAM:2") SendIrCommand("@MSP:1") log("Sending Marantz : Power Off: PWR:1\n")

  1. <$"@PWR:1\r"</s></s>$>

SendIrCommand("@PWR:1")


identifier = cmd.params_[216]

  1. Main volume "TFQ:0xxxxx" from 08700 till + 10800
  2. Multiroom Frequency “MTF:0xxxxx“ from 08700 till + 10800
  3. Multiroom Speakers “MTF:0xxxxx“ from 08700 till + 10800
  1. switch to tuner mode first

SendMultiZoneCommand(cmd, ["@SRC:G", "@MSC:G", "@MSC:G"])

  1. tune to desired frequency

SendMultiZoneCommand(cmd, ["@TFQ:0"+identifier, "@MTF:0"+identifier, "@MTF:0"+identifier]) log("Sending Marantz : Setting tuner frequency to "+identifier+"\n")



level = cmd.params_[76]

  1. Main volume “VOL:0xxx” from - 99 till + 18
  2. Multiroom Speakers "MSV:0xxx" from - 99 till + 0
  3. Multiroom Speakers “MVL:0xxx” from - 99 till + 0

SendMultiZoneCommand(cmd, ["@VOL:0"+level, "@MSV:0"+level, "@MVL:0"+level]) log("Sending Marantz : Set Volume Level to "+level+"\n")