Jump to content
C4 Forums | Control4

Send multiple variables to a macro or similar


Recommended Posts

I would love to be able to call a macro and tell that macro that I'm in the living room, currently listening to pandora and want to switch to Airplay




well. If I could do this, I could make that one macro work for 6 rooms in my house that are requiring the same codE



this would be so nice, it's the way every other programming language works.  I bet tons of people could use this.


i thought that @alanchow  variable manipulator driver would work, but it didn't. Some tweaks, and I bet we could get it to work.  Maybe it's time I learn how to code c4 drivers 

Link to comment
Share on other sites

Sadly, C4 doesn't have the ability to pass parameters.  The C4 programming environment is designed for people that have no programming background and lacks some very basic functions programmers just assume should be there.


It was very disheartening when I realized everything had to be hard coded ... So instead of being able to use one macro with the same logic to handle x rooms, I have x versions of the same macro (slightly better than one macro with a boatload of conditional statements).


Given that most dealers want to do as little programming as possible (and that most users wouldn't want to pay for the time required), I would be extremely surprised to see C4 spend any significant resource in providing anything resembling what a software professional would consider to be a programming platform.

Link to comment
Share on other sites

  • 2 weeks later...

I do this sort of thing by using a dummy room (or a room with no speakers).  For instance, my garage has no speakers so I have a macro that starts playing stuff in the garage based on the logic that I want. I then run the macro and have a set of if statements after the macro which tell which room needs to be added to the garage audio stream. This if statement is essentially passing the variable. Finally I turn the garage off... Maybe I not but I probably should :-)

This has saved me loads of lines of code as I have various music sources and playlists that I want to be able to acces (from my Echo as it happens) and 10 or so rooms that they could apply to...

Link to comment
Share on other sites

  • 1 month later...

string variables would be good to use.

you can have the variable set by the button, av selection, or really anything.

then create one macro

and based on if  you have some things happen.

this will be easy to make adjustments as the variable will likely never change but the macro is edited in one location.

if its gets to be too much in one macro you can break it out into more macros still using a single variable.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.