Page 1 of 9 123 ... LastLast
Results 1 to 10 of 87

Thread: Dm and Meridian Control

  1. #1
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default Dm and Meridian Control

    OK,

    After many hours of code cutting/pasting and debugging (and the help of the various files Rob H sent me) I have finally got something to work, although I must confess I'm still flying in the dark with it!

    I'm trying to control my Meridian 500 series equipment using the device manager, and I'm getting there slowly but am still having some problems.

    I have attached my lua files and the meridian protocol for reference.

    Here are my probelms/questions;
    1. Currently I have the source selection working, but PowerOff and Mute don't work any suggesions as to what I've done wrong?
    2. I can't get the Volume slider in the Receiver or Generic Action to send the command to the Meridian gear (VNxx), how do I add the Volume slider to my provider file? I've got a function AdjustVolume defined in the plugin, but I can't call it from the provider file. (I tried various things but had no luck)
    3. With the Meridian equipment The Surround Processor (56 and DVD (59 are interconnected via a meridian comms cable and the Surround Processor is connected via RS232 to the PC. So all the DVD and Processor commands are sent through the same Serial connection. How should I add the DVD transport and menu commands to the provider file so they appear in the correct place?
    And I guess the other BIG question is, am I doing this correctly in terms of the correct structure for DM? I'm a bit confused with the various "types" that can/should be set and how to structure it all correctly.

    Thanks
    Richard
    Attached Files Attached Files
    Last edited by rpalmer68; March 14th, 2007 at 09:39 PM.

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    For the power and mute commands try adding the line

    Code:
    local plugin = self:GetPlugin()
    as the first line in the GetDeviceTable method

    Re: the volume command, try this

    Code:
    VolumeCommand = function(value) 
       if tonumber(value) then
          plugin:AdjustVolume(tonumber(value))
       end
    end,
    Note that volume levels are standardised from 0 to 100, so if your plugin has a different range you'll have to scale it accordingly. Value can also be one of the strings UP and DOWN so you may want to take account of that too.

    On your third point, I'd add an additional device to the table dt for the DVD player after the main Meridian device, of type AV\\Player

    Other than that, it looks fine to me.
    --Rob

  3. #3
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default

    Thanks Rob,

    I'll try them shortly.

    oh and sorry I put "Ben H" not "Rob H" in my original message (corrected now).

    Ok, next question;

    You'll notice in the meridian Rs232 pdf that PNxx selects the various presets (0 - 23).

    How would I add these to my plugin/provider so that I can have a dropdown list of "Presets" with the words (Direct, Dig THX etc) but map these to the preset numbers for the actual command?

    I assume I do something like this in the provider file (taken from LG sample);
    Code:
    local 568Presets = 
                    {
                        Direct = '0',
                        Music = '1',
                        Trifield = '2',
                        Ambisonics = '3,
                        Super = '4',
                        Stereo = '5',
                       }
    But I'm not sure how to use this to create/populate the "Presets" dt. (gee I'm getting into the lingo now!)

    Cheers
    Richard

  4. #4
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default

    Quote Originally Posted by Rob H View Post
    For the power and mute commands try adding the line

    Code:
    local plugin = self:GetPlugin()
    as the first line in the GetDeviceTable method

    Re: the volume command, try this

    Code:
    VolumeCommand = function(value) 
       if tonumber(value) then
          plugin:AdjustVolume(tonumber(value))
       end
    end,
    That fixed it!

    Thanks
    Last edited by rpalmer68; December 30th, 2006 at 08:03 PM.

  5. #5
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Rob,

    I haven't look through all your stuff carefully but wanted to clarify some stuff. When looking at the DM, we want to break devices down into their basic functions. And in some cases, an external device maybe represented by > 1 device inside Girder. Ie. a security panel may actually have HVAC devices, Security Devices, and Lighting Devices. In you case, it looks like you will a receiver device and a transport devices. I will let Rob H help you with those pieces. It sounds like you are making progress.

  6. #6
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Quote Originally Posted by rpalmer68 View Post
    I assume I do something like this in the provider file (taken from LG sample);
    Code:
    local 568Presets = 
                    {
                        Direct = '0',
                        Music = '1',
                        Trifield = '2',
                        Ambisonics = '3,
                        Super = '4',
                        Stereo = '5',
                       }
    But I'm not sure how to use this to create/populate the "Presets" dt. (gee I'm getting into the lingo now!)
    For that you could use one of the List controls e.g. Dropdown or TextSpin, you would pass in a numerically indexed table i.e. {'Direct', 'Music', 'Trifield'} as the Values property.
    --Rob

  7. #7
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default

    Quote Originally Posted by Rob H View Post
    For that you could use one of the List controls e.g. Dropdown or TextSpin, you would pass in a numerically indexed table i.e. {'Direct', 'Music', 'Trifield'} as the Values property.
    Sorry more questions....

    I've added a dropdown "Presets" to the devicetable, but it doesn't appear in the list of Settings under the Generic Action.

    I assume I have to call a function to add the list/dropdown somehow do I?

    Code:
    GetDeviceTable = function(self)
     local plugin = self:GetPlugin()        
     local dt = {
                ['Meridian 568'] = {Type = 'AV\\Receiver', Name = 'Meridian 568', Description = 'Meridian 568 Surround Processor',
     
                            Sources = {'CD', 'RD', 'LP', 'TV', 'T1','T2', 'CDR', 'CB', 'DVD', 'V1', 'V2', 'LD'}, 
                            SourceCommand = function(source) self.Plugin['Source'..source](self.Plugin) end,
                            PowerCommand = self:MakeToggleFunc(function() plugin:PowerOn() end, function() plugin:PowerOff() end),
                            MuteCommand = self:MakeToggleFunc(function()  plugin:Mute() end, function() plugin:UnMute() end),
                            PresetCommand = {Class = 'Dropdown', ID = 'Presets', Values = {"Direct", "Music", "Trifield"}, Command = function(value) plugin:ChangePreset(value) end},
     
       VolumeCommand = function(value) 
           if tonumber(value) then
                  plugin:AdjustVolume(tonumber(value))
           end
       end,    
        },
      ['Meridian 598'] = {Type = 'AV\\Player', Name = 'Meridian 598', Description = 'Meridian 598 DVD Player',}
           }       
            return dt
        end,
    Cheers
    Richard

  8. #8
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Ah, I see the problem.

    You need to add the control to the optional Controls table ie
    Code:
    GetDeviceTable = function(self)
     local plugin = self:GetPlugin()        
     local dt = {
                ['Meridian 568'] = {Type = 'AV\\Receiver', Name = 'Meridian 568', Description = 'Meridian 568 Surround Processor',
     
                            Sources = {'CD', 'RD', 'LP', 'TV', 'T1','T2', 'CDR', 'CB', 'DVD', 'V1', 'V2', 'LD'}, 
                            SourceCommand = function(source) self.Plugin['Source'..source](self.Plugin) end,
                            PowerCommand = self:MakeToggleFunc(function() plugin:PowerOn() end, function() plugin:PowerOff() end),
                            MuteCommand = self:MakeToggleFunc(function()  plugin:Mute() end, function() plugin:UnMute() end),
                            Controls = {
                                 Presets = {Class = 'Dropdown', ID = 'Presets', Values = {"Direct", "Music", "Trifield"}, Command = function(value) plugin:ChangePreset(value) end},
                             },
     
       VolumeCommand = function(value) 
           if tonumber(value) then
                  plugin:AdjustVolume(tonumber(value))
           end
       end,    
        },
      ['Meridian 598'] = {Type = 'AV\\Player', Name = 'Meridian 598', Description = 'Meridian 598 DVD Player',}
           }       
            return dt
        end,
    --Rob

  9. #9
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    566

    Default

    Thanks,

    I was just looking at the commands linked with the AV\Player type.

    There's power and transport. If this is supposed to cover DVD players, then can I suggest the default definitiont includes menu commands (Top Menu, Menu, Up, Down, Left, Right and Enter) and any other DVD related commands a well. or are these covered somewhere else?

    Off to start the New year drinking, so HAPPY NEW YEAR and thanks for all your help.

    regards
    Richard

  10. #10
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    AV\Player is intended to be the base class for all player devices, not just DVD players. There will be an AV\DVDPlayer class at some point.
    --Rob

Page 1 of 9 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •