Volume control on homegate

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Damaxx, Nov 18, 2009.

  1. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    I am looking to put a master volume control with a slide bar on homegate but dont want all non used amplifers to rise to the current level of volume as it is used.

    Is it best to do this with logic or is there an easier way?
     
    Damaxx, Nov 18, 2009
    #1
  2. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    That will be slightly tricky. The problem is that setting the volume to greater than 0 will also switch on an amplifier.

    It will probably be necessary to use logic.

    If you need help, let us know.
     
    Darren, Nov 18, 2009
    #2
  3. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    Thanks Darren.

    I played with the logic for this a bit but it started to become very messy.
    It would work fine but adjusting a single zone after using the master would cause some strange things to occur. eg all zones mute, single zone goes full volume (neighbours love that one!)

    I have told the boss to be content with individual volume controls until my logic programming improves.

    Appreciate your reply
     
    Damaxx, Nov 24, 2009
    #3
  4. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    It isn't completely clear what you are wanting to do. The devil is in the details :(

    I assume you are wanting something like this:
    1. If you change the Master control, all zones which are switched on will set their volume to match the Master
    2. If you change a single zone, the Master and the other zones will not change

    Is that right?
     
    Darren, Nov 25, 2009
    #4
  5. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    That is spot on Darren. I limited experience with Homegate, as you have probably picked up by now with the last 47 posts you have replied to.... but I thought this may have been something that someone else has done before.
     
    Damaxx, Nov 25, 2009
    #5
  6. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The code below will make three group addresses track a "master" group address to meet the requirements described above.

    First define some constants for the Group Addresses:

    Code:
    { constants }
    MasterVolumeGA = 1;
    VolumeRoom1GA = 2;
    VolumeRoom2GA = 3;
    VolumeRoom3GA = 4;
    
    You will need a couple of variables to store the current master group address level, and also the level it was on the last scan (so you can see if it has changed):

    Code:
    { Global Variables }
    MasterVolumeOnLastScan : integer;
    CurrentMasterVolume : integer;
    
    Initialise the value of the MasterVolumeOnLastScan variable:

    Code:
    { Initialisation }
    MasterVolumeOnLastScan := GetLightingLevel(MasterVolumeGA);
    
    Then in a module, check to see if the master Group Address has changed, and if so, change the other group addresses (if they are on) to match:

    Code:
    CurrentMasterVolume := GetLightingLevel(MasterVolumeGA);
    
    if CurrentMasterVolume <> MasterVolumeOnLastScan then
    begin
      if GetLightingState(VolumeRoom1GA) then
        SetLightingLevel(VolumeRoom1GA, CurrentMasterVolume, 0);
      if GetLightingState(VolumeRoom2GA) then
        SetLightingLevel(VolumeRoom2GA, CurrentMasterVolume, 0);
      if GetLightingState(VolumeRoom3GA) then
        SetLightingLevel(VolumeRoom3GA, CurrentMasterVolume, 0);
      MasterVolumeOnLastScan := CurrentMasterVolume;
    end;
    
     
    Darren, Nov 25, 2009
    #6
  7. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    Thanks yet again

    Cheers Darren.

    Thanks for spending the time to up that code for me.

    There was no way I was going to get to that outcome by myself.

    Very much appreciated. The minister of finance passes on her thanks also.
    It has been a bone of contention since I install this MRA system...

    Will program it soon and let you know how it goes.
     
    Damaxx, Nov 26, 2009
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.