Exemplo n.º 1
0
 void playMovie()
 {
     dvd->on();
     projector->on();
     amplifier->on();
     dvd->play();
 }
 void listenToRadio(double frequency) {
     std::cout << "Tuning in the airwaves..." << std::endl;
     _tuner->on();
     _tuner->setFrequency(frequency);
     _amp->on();
     _amp->setVolume(5);
     _amp->setTuner(_tuner);
 }
 void listenToCd(std::string cdTitle) {
     std::cout << "Get ready for an audiopile experence..." << std::endl;
     _lights->on();
     _amp->on();
     _amp->setVolume(5);
     _amp->setCd(_cd);
     _amp->setStereoSound();
     _cd->on();
     _cd->play(cdTitle);
 }
Exemplo n.º 4
0
 void listenToRadio( double frequency )
 {
   HUM_TRACE(ACE_TEXT("HomeTheaterFacade::listenToRadio"));
   std::cout << "Tuning in the airwaves..." << std::endl;
   _tuner->on();
   _tuner->setFrequency( frequency );
   _amp->on();
   _amp->setVolume( 5 );
   _amp->setTuner( _tuner );
 }
Exemplo n.º 5
0
 void listenToCd( std::string cdTitle )
 {
   HUM_TRACE(ACE_TEXT("HomeTheaterFacade::listenToCd"));
   std::cout << "Get ready for an audiopile experence..." << std::endl;
   _lights->on();
   _amp->on();
   _amp->setVolume( 5 );
   _amp->setCd( _cd );
   _amp->setStereoSound();
   _cd->on();
   _cd->play( cdTitle );
 }
 void watchMovie(std::string movie) {
     std::cout << "Get ready to watch a movie..." << std::endl;
     _popper->on();
     _popper->pop();
     _lights->dim(10);
     _screen->down();
     _projector->on();
     _projector->wideScreenMode();
     _amp->on();
     _amp->setDvd(_dvd);
     _amp->setSurroundSound();
     _amp->setVolume(5);
     _dvd->on();
     _dvd->play(movie);
 }
Exemplo n.º 7
0
 void watchMovie( std::string movie )
 {
   HUM_TRACE(ACE_TEXT("HomeTheaterFacade::watchMovie"));
   std::cout << "Get ready to watch a movie..." << std::endl;
   _popper->on();
   _popper->pop();
   _lights->dim( 10 );
   _screen->down();
   _projector->on();
   _projector->wideScreenMode();
   _amp->on();
   _amp->setDvd( _dvd );
   _amp->setSurroundSound();
   _amp->setVolume( 5 );
   _dvd->on();
   _dvd->play( movie );
 }
Exemplo n.º 8
0
int main()
{
    DVD dvd;
    Amplifier amplifier;
    Projector projector;
    // non-facade method
    // play movie
    cout<<"################# Non-facade Pattern ####################"<<endl;
    dvd.on();
    projector.on();
    amplifier.on();
    dvd.play();

    // using facade pattern
    cout<<"################# Facade Pattern ####################"<<endl;
    FacadeThreater ft(&dvd, &amplifier, &projector);
    ft.playMovie();
    return 0;
}