![](/media/cache/profiles/89a26a363b87a87ac6a94277e841b7f4.50x50_q85.jpg)
The codebase to run the *spark d-fuser controller www.sparkav.co.uk/dvimixer
Dependencies: SPK-TVOne DMX DmxArtNet NetServicesMin OSC PinDetect mRotaryEncoder iniparser mbed spk_oled_ssd1305 filter
Diff: main.cpp
- Revision:
- 12:c270870bdd23
- Parent:
- 11:0783cfbeb746
- Child:
- 13:3796bde6ba8f
--- a/main.cpp Mon Aug 27 15:10:23 2012 +0000 +++ b/main.cpp Tue Aug 28 15:41:51 2012 +0000 @@ -145,11 +145,14 @@ SPKMenuOfMenus mainMenu; SPKMenuPayload resolutionMenu; SPKMenuPayload mixModeMenu; +SPKMenuPayload advancedMenu; + enum { blend, additive, key }; // additive will require custom TVOne firmware. int mixMode = blend; SPKMenuPayload commsMenu; enum { commsNone, commsOSC, commsArtNet, commsDMXIn, commsDMXOut}; int commsMode = commsNone; +enum { advancedHDCPOn, advancedHDCPOff }; // RJ45 Comms enum { rj45Ethernet = 0, rj45DMX = 1}; // These values from circuit @@ -340,10 +343,14 @@ commsMenu.addMenuItem("DMX In", commsDMXIn, 0); commsMenu.addMenuItem("DMX Out", commsDMXOut, 0); + advancedMenu.title = "Processor Advanced"; + advancedMenu.addMenuItem("HDCP Off", advancedHDCPOff, 0); + mainMenu.title = "Main Menu"; mainMenu.addMenuItem(&mixModeMenu); mainMenu.addMenuItem(&resolutionMenu); mainMenu.addMenuItem(&commsMenu); + mainMenu.addMenuItem(&advancedMenu); selectedMenu = &mainMenu; lastSelectedMenu = &mainMenu; @@ -353,16 +360,9 @@ fadeAPO.period(0.001); fadeBPO.period(0.001); - // TVOne setup - - bool ok = true; + // TODO: Test for TVOne connectivity here and display in status line - // horrid, horrid HDCP - ok = tvOne.setHDCPOff(); - - std::string sendOK = ok ? "Sent: HDCP Off" : "Send Error: HDCP Off"; - - // display menu and framing lines + // Display menu and framing lines screen.horizLineToBuffer(kMenuLine1*pixInPage - 1); screen.clearBufferRow(kMenuLine1); screen.textToBuffer(selectedMenu->title, kMenuLine1); @@ -373,7 +373,6 @@ screen.clearBufferRow(kCommsStatusLine); screen.textToBuffer(commsMenu.selectedString(), kCommsStatusLine); screen.clearBufferRow(kTVOneStatusLine); - screen.textToBuffer(sendOK, kTVOneStatusLine); screen.sendBuffer(); @@ -624,6 +623,20 @@ screen.clearBufferRow(kCommsStatusLine); screen.textToBuffer(commsTypeString + commsStatus.str(), kCommsStatusLine); } + else if (selectedMenu == &advancedMenu) + { + if (advancedMenu.selectedPayload1() == advancedHDCPOff) + { + bool ok = false; + + ok = tvOne.setHDCPOff(); + + std::string sendOK = ok ? "Sent: HDCP Off" : "Send Error: HDCP Off"; + + screen.clearBufferRow(kTVOneStatusLine); + screen.textToBuffer(sendOK, kTVOneStatusLine); + } + } else { if (debug) { debug->printf("Warning: No action identified"); }