// ---------------------------------------------------------------------------- // bool HttpRestServices::edit_venue_layout_save( CString& response, LPCSTR data, DWORD size, LPCSTR content_type ) { Venue* venue = studio.getVenue(); if ( !venue ) return false; venue->setVenueLayout( data ); return true; }
// ---------------------------------------------------------------------------- // bool HttpRestServices::query_venue_layout( CString& response, LPCSTR data ) { Venue* venue = studio.getVenue(); if ( !venue ) return false; LPCSTR layout = venue->getVenueLayout(); if ( layout == NULL ) return false; response = layout; return true; }
ShowAtVenue::ShowAtVenue(const Show& show, const Venue& venue, const char* date) { m_show = show; m_venue = venue; m_date = _strdup(date); m_numOfPeople = 0; m_seatArr = new Contact**[venue.getNumOfRows()]; //Dynamic allocate the Seats array ROWS for (int i = 0; i < venue.getNumOfRows(); i++) { m_seatArr[i] = new Contact*[venue.getNumOfSeatsPerRow()]; for (int j = 0; j < venue.getNumOfSeatsPerRow(); j++) { m_seatArr[i][j] = NULL; //If seat is not taken the value is NULL } } }
int main() { Venue theSpot; theSpot.addEvent(10, "Coffee Hour"); //Should work -works! theSpot.addEvent(11, "Brunch w/ Bob"); //Should work -works! theSpot.addEvent(11, "Bingo"); //Shouldn't work -doesn't work! cout << theSpot.findEvent(10).getTitle() << endl; //Should find Coffee Hour -does! cout << theSpot.findEvent("Brunch w/ Bob").getTime() << endl; //Should find 11 o'clock -does! cout << theSpot.findEvent("Bingo").getTime() << endl; //Should print -1, because Bingo ain't there! -does! return 0; }
int main() { //Creates a venue to be utilized Venue theVenue; //Creates an event in the venue at 10 called wedding, displays "Event scheduled" theVenue.addEvent(10, "Wedding"); //Creates an event in the venue at 8 called business meeting, displays "Event scheduled" theVenue.addEvent(8, "Business Meeting"); //Will not create this event, because the time is already taken, displays error message theVenue.addEvent(10, "Poker Night"); //will find and display the event at 10, wedding cout << theVenue.findEvent(10).getTitle() << endl; //will find and display the event called business meeting, 8 cout << theVenue.findEvent("Business Meeting").getTime() << endl; //will return -1, because the event poker night does not exist cout << theVenue.findEvent("Poker Night").getTime() << endl; //will return Free, because there is no event at 6 cout << theVenue.findEvent(6).getTitle() << endl; return 0; }
// ---------------------------------------------------------------------------- // bool HttpRestServices::edit_venue_update( CString& response, LPCSTR data, DWORD size, LPCSTR content_type ) { Venue* venue = studio.getVenue(); if ( !venue ) return false; SimpleJsonParser parser; try { parser.parse( data ); CString name = parser.get<CString>( "name" ); CString description = parser.get<CString>( "description" ); CString dmx_port = parser.get<CString>( "dmx_port" ); CString audio_capture_device = parser.get<CString>( "audio_capture_device" ); int dmx_packet_delay_ms = parser.get<int>( "dmx_packet_delay_ms" ); int dmx_minimum_delay_ms = parser.get<int>( "dmx_minimum_delay_ms" ); int audio_sample_size = parser.get<int>( "audio_sample_size" ); float audio_boost = parser.get<float>( "audio_boost" ); float audio_boost_floor = parser.get<float>( "audio_boost_floor" ); int auto_blackout = parser.get<int>( "auto_blackout" ); // There may be a better solution for this, but we need to kill all attached sound devices before the reset m_sound_sampler.detach(); venue->close(); venue->setName( name ); venue->setDescription( description ); venue->setDmxPort( dmx_port ); venue->setDmxPacketDelayMS( dmx_packet_delay_ms ); venue->setDmxMinimumDelayMS( dmx_minimum_delay_ms ); venue->setAudioCaptureDevice( audio_capture_device ); venue->setAudioBoost( audio_boost ); venue->setAudioBoostFloor( audio_boost_floor ); venue->setAudioSampleSize( audio_sample_size ); venue->setAutoBlackout( auto_blackout ); venue->open(); } catch ( std::exception& e ) { throw StudioException( "JSON parser error (%s) data (%s)", e.what(), data ); } return true; }
// ---------------------------------------------------------------------------- // bool HttpRestServices::query_venue_describe( CString& response, LPCSTR data ) { Venue* venue = studio.getVenue(); if ( !venue ) return false; JsonBuilder json( response ); json.startObject(); json.add( "name", venue->getName() ); json.add( "description", venue->getDescription() ); json.add( "auto_blackout", venue->getAutoBlackout() ); json.add( "dmx_port", venue->getDmxPort() ); json.add( "dmx_packet_delay_ms", venue->getDmxPacketDelayMS() ); json.add( "dmx_minimum_delay_ms", venue->getDmxMinimumDelayMS() ); json.add( "audio_capture_device", venue->getAudioCaptureDevice() ); json.add( "audio_sample_size", venue->getAudioSampleSize() ); json.add( "audio_boost", venue->getAudioBoost() ); json.add( "audio_boost_floor", venue->getAudioBoostFloor() ); json.startArray( "ports" ); for ( int i=1; i <= 12; i++ ) { CString com_port; com_port.Format( "com%d", i ); json.add( com_port ); } json.endArray( "ports" ); json.startArray( "capture_devices" ); for ( AudioCaptureDeviceArray::iterator it=AudioInputStream::audioCaptureDevices.begin(); it != AudioInputStream::audioCaptureDevices.end(); ++it ) json.add( (*it).m_friendly_name ); json.endArray( "capture_devices" ); json.endObject(); return true; }