void CPetInventoryGlyph::unhighlightCurrent() {
	if (_image) {
		_image->setPosition(Point(0, 0));
		stopMovie();
	} else if (_background) {
		_background->setPosition(Point(0, 0));
		_background->loadFrame(0);
		stopMovie();
	}
}
示例#2
0
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
	debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechStartedMsg flags=%x dialogueId=%d",
		getName().c_str(), _npcFlags, msg->_dialogueId);

	_npcFlags |= NPCFLAG_SPEAKING;
	++_speechCounter;

	if (!(_npcFlags & NPCFLAG_8)) {
		// Stop any previous animation
		if (_speechTimerId)
			stopAnimTimer(_speechTimerId);
		_speechTimerId = 0;

		_speechDuration = msg->_speechDuration;
		_startTicks = getTicksCount();

		if (!hasActiveMovie() || (_npcFlags & NPCFLAG_IDLING)) {
			_npcFlags &= ~NPCFLAG_IDLING;
			stopMovie();

			CNPCPlayTalkingAnimationMsg msg1(_speechDuration, 0, nullptr);
			msg1.execute(this);

			if (msg1._names) {
				CNPCPlayAnimationMsg msg2(msg1._names, msg1._speechDuration);
				msg2.execute(this);
			}
		}
	}

	return true;
}
示例#3
0
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
	_npcFlags |= NPCFLAG_SPEAKING;
	++_field100;

	if (!(_npcFlags & NPCFLAG_8)) {
		if (_speechTimerId)
			stopTimer(_speechTimerId);

		_soundId = msg->_soundId;
		_fieldF0 = getTicksCount();

		if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
			_npcFlags &= ~NPCFLAG_2;
			stopMovie();

			CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
			msg1.execute(this);

			if (msg1._names) {
				CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
				msg2.execute(this);
			}
		}
	}

	return true;
}
示例#4
0
OpenCVWidget::OpenCVWidget(QWidget *parent) :
        QWidget(parent),        
        ui(new Ui::OpenCVWidget)
{
    ui->setupUi(this);

    OverlayData* overlayData = new OverlayData(300, 300, this);
    QHBoxLayout* hlButtons = new QHBoxLayout();
    btPlay = new QPushButton(QIcon(":/icons/Play.png"), "", this);
    btStop = new QPushButton(QIcon(":/icons/Stop.png"), "", this);
    btFile = new QPushButton(QIcon(":/icons/Open.png"), "", this);
    btRTSP = new QPushButton(QIcon(":/icons/Radio.png"), "", this);
    btRecord = new QPushButton(QIcon(":/icons/Record.png"), "", this);

    cxFilter = new QCheckBox("Filter", this);
    cxFilter->setCheckable(true);
    cxFilter->setChecked(false);
    cxStabilizer = new QCheckBox("Stabilize", this);
    cxStabilizer->setCheckable(true);
    cxStabilizer->setChecked(false);
    slSizeKernel = new QSlider(Qt::Horizontal, this);
    slSizeKernel->setMinimum(1);
    slSizeKernel->setMaximum(12);
    slSizeKernel->setValue(1);

    lbTitle = new QLabel("---");
    lbTitle->setMaximumHeight(15);

    hlButtons->addWidget(btPlay);
    hlButtons->addWidget(btStop);
    hlButtons->addWidget(btFile);
    hlButtons->addWidget(btRTSP);
    hlButtons->addWidget(btRecord);

    connect(btPlay, SIGNAL(clicked()), overlayData, SLOT(playMovie()));
    connect(btStop, SIGNAL(clicked()), overlayData, SLOT(stopMovie()));
    connect(btFile, SIGNAL(clicked()), overlayData, SLOT(openFile()));
    connect(btRTSP, SIGNAL(clicked()), overlayData, SLOT(openRTSP()));
    connect(btRecord, SIGNAL(clicked()), overlayData, SLOT(record()));
    connect(overlayData, SIGNAL(emitCaptureImage(QImage)), this, SLOT(showCaptureImage(QImage)));
    connect(overlayData, SIGNAL(emitTitle(QString)), lbTitle, SLOT(setText(QString)));

    connect(cxFilter, SIGNAL(stateChanged(int)), overlayData, SLOT(setEnableFilter(int)));
    connect(cxStabilizer, SIGNAL(stateChanged(int)), overlayData, SLOT(setEnableStabilizer(int)));
    connect(slSizeKernel, SIGNAL(valueChanged(int)), overlayData, SLOT(setSizeKernel(int)));

    QVBoxLayout* vlControls = new QVBoxLayout();

    vlControls->addWidget(overlayData);
    vlControls->addLayout(hlButtons);
    vlControls->addWidget(cxFilter);
    vlControls->addWidget(cxStabilizer);
    vlControls->addWidget(slSizeKernel);
    vlControls->addWidget(lbTitle);

    setLayout(vlControls);

    setWindowTitle("VIDEO");
}
示例#5
0
bool CTelevision::StatusChangeMsg(CStatusChangeMsg *msg) {
	if (_isOn) {
		stopMovie();
		playMovie(0);
	}

	return true;
}
bool CMusicConsoleButton::LeaveViewMsg(CLeaveViewMsg *msg) {
	if (_isActive) {
		CStopMusicMsg stopMsg(this);
		stopMsg.execute(this);
		stopMovie();
		loadFrame(0);
	}

	return true;
}
示例#7
0
bool CParrot::PanningAwayFromParrotMsg(CPanningAwayFromParrotMsg *msg) {
	if (_v4) {
		CActMsg actMsg("PanAwayFromParrot");
		actMsg.execute(msg->_target);
		_field134 = 0;
	} else if (_v2) {
		_field134 = msg->_target;
		loadMovie("z168.avi", false);
		stopMovie();
		playClip("Take Off", MOVIE_NOTIFY_OBJECT);
		_npcFlags |= NPCFLAG_2000000;
	} else {
		_npcFlags |= NPCFLAG_400000;
		_field134 = msg->_target;
		stopMovie();
	}

	return true;
}
示例#8
0
文件: deskbot.cpp 项目: 86400/scummvm
bool CDeskbot::TurnOff(CTurnOff *msg) {
    if (_deskbotActive) {
        stopMovie();
        performAction(1, findView());

        _npcFlags = (_npcFlags & ~(NPCFLAG_SPEAKING | NPCFLAG_IDLING | NPCFLAG_START_IDLING)) | NPCFLAG_40000;
        playClip("Closing", MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
    }

    return true;
}
示例#9
0
文件: doorbot.cpp 项目: 86400/scummvm
bool CDoorbot::DoorbotNeededInHomeMsg(CDoorbotNeededInHomeMsg *msg) {
	moveToView();
	setPosition(Point(90, 42));
	_npcFlags = NPCFLAG_100000;

	stopMovie();
	playClip("Cloak Off", MOVIE_NOTIFY_OBJECT);

	_npcFlags |= NPCFLAG_8;
	return true;
}
示例#10
0
bool CPlayMusicButton::FrameMsg(CFrameMsg *msg) {
	if (_flag && !CMusicRoom::_musicHandler->isBusy()) {
		CMusicRoom *musicRoom = getMusicRoom();
		musicRoom->stopMusic();
		stopMovie();
		loadFrame(0);
		_flag = false;
	}

	return true;
}
示例#11
0
bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
	if (msg->_name == "Television" && _isOn) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, 0);

		_channelNum = (_channelNum % _channelsCount) + 1;
		stopMovie();
		playMovie(START_FRAMES[_channelNum], END_FRAMES[_channelNum], MOVIE_NOTIFY_OBJECT);
	}

	return true;
}
示例#12
0
bool CTelevision::ActMsg(CActMsg *msg) {
	if (msg->_action == "TurnTVOnOff") {
		_isOn = !_isOn;
		if (_isOn) {
			setVisible(true);
			CStatusChangeMsg changeMsg;
			changeMsg.execute(this);
		} else {
			setVisible(_isOn);
			stopMovie();
		}
	}

	return true;
}
示例#13
0
bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
	stopMovie();

	if (msg->_mousePos.y >= 360) {
		petAddToInventory();
		return true;
	}

	if (compareViewNameTo("ParrotLobby.Node 1.N")) {
		if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
				!CParrot::_v2 && !CCage::_open) {
			setVisible(false);
			_fieldE0 = 0;
			CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
			detach();
			addUnder(perchedParrot);
			sound8(true);

			CPutParrotBackMsg backMsg(msg->_mousePos.x);
			backMsg.execute(perchedParrot);
		} else {
			setVisible(false);
			_fieldE0 = 0;
			CParrot::_v4 = 2;
			playSound("z#475.wav");
			sound8(true);
			moveUnder(findRoom());

			CActMsg actMsg("Shut");
			actMsg.execute("ParrotCage");
		}
	} else {
		CCharacter *character = dynamic_cast<CCharacter *>(msg->_dropTarget);
		if (character) {
			CUseWithCharMsg charMsg(character);
			charMsg.execute(this, nullptr, 0);
		} else {
			setVisible(false);
			_fieldE0 = 0;
			playSound("z#475.wav");
			sound8(true);
			moveUnder(findRoom());
		}
	}

	showMouse();
	return true;
}
示例#14
0
bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) {
	CPetControl *pet = getPetControl();
	if (msg->_value == _field1DC)
		return true;
	if (mailExists(pet->getRoomFlags()))
		return false;

	_field1DC = msg->_value;
	if (_field1DC) {
		CGameObject *item = msg->_object;
		_string3 = item->getName();
		CHoseConnectedMsg hoseMsg(1, this);
		hoseMsg.execute(msg->_object);
		item->petMoveToHiddenRoom();

		CPumpingMsg pumpingMsg(1, this);
		pumpingMsg.execute(this);
		_field1DC = 1;

		if (_enabled) {
			_enabled = false;
		} else {
			playMovie(_startFrame9, _endFrame9, 0);
			playSound("z#26.wav");
		}

		playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT);
	} else {
		stopMovie();
		stopSound(_field1EC);
		playMovie(_field1F0, _field1F4, MOVIE_NOTIFY_OBJECT);

		CPumpingMsg pumpingMsg(0, this);
		pumpingMsg.execute(_string3);

		CGameObject *obj = getHiddenObject(_string3);
		if (obj) {
			obj->petAddToInventory();
			obj->setVisible(true);
		}

		_enabled = true;
		CTurnOff offMsg;
		offMsg.execute(this);
	}

	return true;
}
示例#15
0
bool CPlayMusicButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	CMusicRoom *musicRoom = getMusicRoom();
	if (_flag) {
		musicRoom->stopMusic();
		stopMovie();
		loadFrame(0);
		_flag = false;
	} else {
		musicRoom->startMusic(100);
		playMovie(MOVIE_REPEAT);
		_ticks = getTicksCount();
		_flag = true;
	}

	return true;
}
示例#16
0
bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) {
	petClear();
	if (_isOn) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, 0);

		loadFrame(622);
		stopMovie();
		setVisible(0);
		_isOn = false;

		if (compareRoomNameTo("CSGState")) {
			CVisibleMsg visibleMsg(true);
			visibleMsg.execute("Tellypic");
		}
	}

	return true;
}
bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
	if (!_item)
		return false;

	if (_background) {
		_field34 = 0;
		stopMovie();
	}

	CPetControl *petControl = getPetControl();
	if (!petControl)
		return false;

	CGameObject *carryParcel = petControl->getHiddenObject("CarryParcel");

	if (petControl->isSuccUBusActive() && carryParcel) {
		petControl->removeFromInventory(_item, carryParcel, false, true);
		petControl->removeFromInventory(_item, false, false);

		carryParcel->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2,
			msg->_mousePos.y - carryParcel->getBounds().height() / 2));
		_item->setPosition(Point(SCREEN_WIDTH, SCREEN_HEIGHT));
	} else {
		petControl->removeFromInventory(_item, false, true);

		_item->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2,
			msg->_mousePos.y - carryParcel->getBounds().height() / 2));
		_item->setVisible(true);
	}

	msg->_handled = true;
	if (msg->execute(carryParcel)) {
		_item = nullptr;
		_background = nullptr;
		_field34 = 0;
		petControl->setAreaChangeType(1);
		return true;
	} else {
		petControl->addToInventory(carryParcel);
		return false;
	}
}
示例#18
0
bool CParrot::ActMsg(CActMsg *msg) {
	if (msg->_action == "PistaccioEaten") {
		CActMsg actMsg("NutsEaten");
		actMsg.execute("Ear2");
	} else if (msg->_action == "Chicken") {
		// Nothing to do
	} else if (msg->_action == "CarryParrotLeftView") {
		if (!_v2) {
			_v1 = 0;
			CStatusChangeMsg statusMsg;
			statusMsg._newStatus = 1;
			statusMsg.execute("PerchCoreHolder");
		}
	} else if (msg->_action == "StartChickenDrag") {
		if (!_v4) {
			stopMovie();
			startTalking(this, 280275, findView());
			_field12C = 0;
		}
	} else if (msg->_action == "EnteringFromTOW" &&
			(_v4 == 0 || _v4 == 2)) {
		if (_v2) {
			_v2 = 2;
		} else {
			setVisible(true);
			CTreeItem *cageBar = getRoot()->findByName("CageBar");
			detach();
			attach(cageBar);

			_v4 = 0;
			CActMsg actMsg1("OpenNow");
			actMsg1.execute("ParrotCage");
			CActMsg actMsg2("GainParrot");
			actMsg2.execute("ParrotLobbyController");
		}
	}

	return true;
}
示例#19
0
bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
	if (msg->_name == "Television") {
		CVisibleMsg visibleMsg(_isOn);
		_isOn = !_isOn;

		if (_isOn) {
			setVisible(true);
			playMovie(0, 55, 0);
			_channelNum = 1;
		} else {
			stopMovie();
			if (isSoundActive(_soundHandle))
				stopSound(_soundHandle, 0);

			setVisible(false);
		}

		if (compareRoomNameTo("SGTState"))
			visibleMsg.execute("Tellypic");
	}

	return true;
}
bool CMusicConsoleButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_isActive) {
		CStopMusicMsg stopMsg(this);
		stopMsg.execute(this);
		stopMovie();
		loadFrame(0);
	} else {
		CStartMusicMsg startMsg(this);
		startMsg.execute(this);
		playMovie(MOVIE_REPEAT);

		CMusicHasStartedMsg startedMsg;
		startedMsg.execute("Music Room Phonograph");
	
		if (CMusicRoom::_musicHandler->checkSound(1)
				&& CMusicRoom::_musicHandler->checkSound(2)
				&& CMusicRoom::_musicHandler->checkSound(3)) {
			CCorrectMusicPlayedMsg correctMsg;
			correctMsg.execute(findRoom());
		}
	}

	return true;
}
示例#21
0
MainWindow::MainWindow() : QbWindow(config().geometry.mainWindow) {
  setObjectName("main-window");
  setWindowTitle(string() << bsnesTitle << " v" << bsnesVersion);
  setCloseOnEscape(false);

  //menu bar
  #if defined(PLATFORM_OSX)
  menuBar = new QMenuBar(0);
  #else
  menuBar = new QMenuBar;
  #endif

  system = menuBar->addMenu("&System");

  system_load = system->addAction("Load &Cartridge ...");
  system_load->setIcon(QIcon(":/16x16/document-open.png"));

  system_loadSpecial = system->addMenu("Load &Special");
  system_loadSpecial->setIcon(QIcon(":/16x16/document-open.png"));

  system_loadSpecial_bsxSlotted = system_loadSpecial->addAction("Load BS-X &Slotted Cartridge ...");
  system_loadSpecial_bsxSlotted->setIcon(QIcon(":/16x16/document-open.png"));

  system_loadSpecial_bsx = system_loadSpecial->addAction("Load &BS-X Cartridge ...");
  system_loadSpecial_bsx->setIcon(QIcon(":/16x16/document-open.png"));

  system_loadSpecial_sufamiTurbo = system_loadSpecial->addAction("Load Sufami &Turbo Cartridge ...");
  system_loadSpecial_sufamiTurbo->setIcon(QIcon(":/16x16/document-open.png"));

  system_loadSpecial_superGameBoy = system_loadSpecial->addAction("Load Super &Game Boy Cartridge ...");
  system_loadSpecial_superGameBoy->setIcon(QIcon(":/16x16/document-open.png"));

  system->addSeparator();

  system->addAction(system_power = new QbCheckAction("&Power", 0));

  system_reset = system->addAction("&Reset");
  system_reset->setIcon(QIcon(":/16x16/view-refresh.png"));

  system->addSeparator();

  system_port1 = system->addMenu("Controller Port &1");
  system_port1->setIcon(QIcon(":/16x16/input-gaming.png"));
  system_port1->addAction(system_port1_none = new QbRadioAction("&None", 0));
  system_port1->addAction(system_port1_gamepad = new QbRadioAction("&Gamepad", 0));
  system_port1->addAction(system_port1_asciipad = new QbRadioAction("&asciiPad", 0));
  system_port1->addAction(system_port1_multitap = new QbRadioAction("&Multitap", 0));
  system_port1->addAction(system_port1_mouse = new QbRadioAction("&Mouse", 0));

  system_port2 = system->addMenu("Controller Port &2");
  system_port2->setIcon(QIcon(":/16x16/input-gaming.png"));
  system_port2->addAction(system_port2_none = new QbRadioAction("&None", 0));
  system_port2->addAction(system_port2_gamepad = new QbRadioAction("&Gamepad", 0));
  system_port2->addAction(system_port2_asciipad = new QbRadioAction("&asciiPad", 0));
  system_port2->addAction(system_port2_multitap = new QbRadioAction("&Multitap", 0));
  system_port2->addAction(system_port2_mouse = new QbRadioAction("&Mouse", 0));
  system_port2->addAction(system_port2_superscope = new QbRadioAction("&Super Scope", 0));
  system_port2->addAction(system_port2_justifier = new QbRadioAction("&Justifier", 0));
  system_port2->addAction(system_port2_justifiers = new QbRadioAction("Two &Justifiers", 0));

  #if !defined(PLATFORM_OSX)
  system->addSeparator();
  #endif

  system_exit = system->addAction("E&xit");
  system_exit->setIcon(QIcon(":/16x16/process-stop.png"));
  system_exit->setMenuRole(QAction::QuitRole);

  settings = menuBar->addMenu("S&ettings");

  settings_videoMode = settings->addMenu("Video &Mode");
  settings_videoMode->setIcon(QIcon(":/16x16/video-display.png"));

  settings_videoMode->addAction(settings_videoMode_1x = new QbRadioAction("Scale &1x", 0));

  settings_videoMode->addAction(settings_videoMode_2x = new QbRadioAction("Scale &2x", 0));

  settings_videoMode->addAction(settings_videoMode_3x = new QbRadioAction("Scale &3x", 0));

  settings_videoMode->addAction(settings_videoMode_4x = new QbRadioAction("Scale &4x", 0));

  settings_videoMode->addAction(settings_videoMode_5x = new QbRadioAction("Scale &5x", 0));

  settings_videoMode->addSeparator();

  settings_videoMode->addAction(settings_videoMode_correctAspectRatio = new QbCheckAction("Correct &Aspect Ratio", 0));

  settings_videoMode->addSeparator();

  settings_videoMode->addAction(settings_videoMode_ntsc = new QbRadioAction("&NTSC", 0));
  settings_videoMode->addAction(settings_videoMode_pal = new QbRadioAction("&PAL", 0));

  if(filter.opened()) {
    settings_videoFilter = settings->addMenu("Video &Filter");
    settings_videoFilter->setIcon(QIcon(":/16x16/image-x-generic.png"));

    settings_videoFilter_configure = settings_videoFilter->addAction("&Configure Active Filter ...");
    settings_videoFilter_configure->setIcon(QIcon(":/16x16/preferences-desktop.png"));
    settings_videoFilter->addSeparator();

    settings_videoFilter->addAction(settings_videoFilter_none = new QbRadioAction("&None", 0));
    settings_videoFilter_list.add(settings_videoFilter_none);

    lstring filterlist;
    filterlist.split(";", filter.dl_supported());
    for(unsigned i = 0; i < filterlist.size(); i++) {
      QbRadioAction *action = new QbRadioAction(filterlist[i], 0);
      settings_videoFilter->addAction(action);
      settings_videoFilter_list.add(action);
    }
  }

  settings->addAction(settings_smoothVideo = new QbCheckAction("&Smooth Video Output", 0));

  settings->addSeparator();

  settings->addAction(settings_muteAudio = new QbCheckAction("&Mute Audio Output", 0));

  settings->addSeparator();

  settings_emulationSpeed = settings->addMenu("Emulation &Speed");
  settings_emulationSpeed->setIcon(QIcon(":/16x16/appointment-new.png"));

  settings_emulationSpeed->addAction(settings_emulationSpeed_slowest = new QbRadioAction("Slowest", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_slow = new QbRadioAction("Slow", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_normal = new QbRadioAction("Normal", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_fast = new QbRadioAction("Fast", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_fastest = new QbRadioAction("Fastest", 0));

  settings_emulationSpeed->addSeparator();

  settings_emulationSpeed->addAction(settings_emulationSpeed_syncVideo = new QbCheckAction("Sync &Video", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_syncAudio = new QbCheckAction("Sync &Audio", 0));

  settings_configuration = settings->addAction("&Configuration ...");
  settings_configuration->setIcon(QIcon(":/16x16/preferences-desktop.png"));
  settings_configuration->setMenuRole(QAction::PreferencesRole);

  tools = menuBar->addMenu("&Tools");

  tools_movies = tools->addMenu("&Movies");
  tools_movies->setIcon(QIcon(":/16x16/applications-multimedia.png"));

  tools_movies_play = tools_movies->addAction("Play Movie ...");
  tools_movies_play->setIcon(QIcon(":/16x16/media-playback-start.png"));

  tools_movies_stop = tools_movies->addAction("Stop");
  tools_movies_stop->setIcon(QIcon(":/16x16/media-playback-stop.png"));

  tools_movies_recordFromPowerOn = tools_movies->addAction("Record Movie (and restart system)");
  tools_movies_recordFromPowerOn->setIcon(QIcon(":/16x16/media-record.png"));

  tools_movies_recordFromHere = tools_movies->addAction("Record Movie (starting from here)");
  tools_movies_recordFromHere->setIcon(QIcon(":/16x16/media-record.png"));

  tools_captureScreenshot = tools->addAction("&Capture Screenshot");
  tools_captureScreenshot->setIcon(QIcon(":/16x16/image-x-generic.png"));

  tools->addSeparator();

  tools_dialog = tools->addAction("&Tools Dialog ...");
  tools_dialog->setIcon(QIcon(":/16x16/preferences-desktop.png"));

  tools_debugger = tools->addAction("&Debugger ...");
  tools_debugger->setIcon(QIcon(":/16x16/utilities-terminal.png"));
  #if !defined(DEBUGGER)
  tools_debugger->setVisible(false);
  #endif

  help = menuBar->addMenu("&Help");

  help_documentation = help->addAction("&Documentation ...");
  help_documentation->setIcon(QIcon(":/16x16/text-x-generic.png"));

  help_license = help->addAction("&License ...");
  help_license->setIcon(QIcon(":/16x16/text-x-generic.png"));

  #if !defined(PLATFORM_OSX)
  help->addSeparator();
  #endif

  help_about = help->addAction("&About ...");
  help_about->setIcon(QIcon(":/16x16/help-browser.png"));
  help_about->setMenuRole(QAction::AboutRole);

  //canvas
  canvasContainer = new CanvasObject;
  canvasContainer->setAcceptDrops(true); {
    canvasContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    canvasContainer->setObjectName("backdrop");

    canvasLayout = new QVBoxLayout; {
      canvasLayout->setMargin(0);
      canvasLayout->setAlignment(Qt::AlignCenter);

      canvas = new CanvasWidget;
      canvas->setAcceptDrops(true);
      canvas->setFocusPolicy(Qt::StrongFocus);
      canvas->setAttribute(Qt::WA_PaintOnScreen, true);  //disable Qt painting on focus / resize

      QPalette palette;
      palette.setColor(QPalette::Window, QColor(0, 0, 0));
      canvas->setPalette(palette);
      canvas->setAutoFillBackground(true);
    }
    canvasLayout->addWidget(canvas);
  }
  canvasContainer->setLayout(canvasLayout);

  //status bar
  statusBar = new QStatusBar;
  statusBar->showMessage("");
  systemState = new QLabel;
  statusBar->addPermanentWidget(systemState);

  //layout
  layout = new QVBoxLayout;
  layout->setMargin(0);
  layout->setSpacing(0);
  #if !defined(PLATFORM_OSX)
  layout->addWidget(menuBar);
  #endif
  layout->addWidget(canvasContainer);
  layout->addWidget(statusBar);
  setLayout(layout);

  //slots
  connect(system_load, SIGNAL(triggered()), this, SLOT(loadCartridge()));
  connect(system_loadSpecial_bsxSlotted, SIGNAL(triggered()), this, SLOT(loadBsxSlottedCartridge()));
  connect(system_loadSpecial_bsx, SIGNAL(triggered()), this, SLOT(loadBsxCartridge()));
  connect(system_loadSpecial_sufamiTurbo, SIGNAL(triggered()), this, SLOT(loadSufamiTurboCartridge()));
  connect(system_loadSpecial_superGameBoy, SIGNAL(triggered()), this, SLOT(loadSuperGameBoyCartridge()));
  connect(system_power, SIGNAL(triggered()), this, SLOT(power()));
  connect(system_reset, SIGNAL(triggered()), this, SLOT(reset()));
  connect(system_port1_none, SIGNAL(triggered()), this, SLOT(setPort1None()));
  connect(system_port1_gamepad, SIGNAL(triggered()), this, SLOT(setPort1Gamepad()));
  connect(system_port1_asciipad, SIGNAL(triggered()), this, SLOT(setPort1Asciipad()));
  connect(system_port1_multitap, SIGNAL(triggered()), this, SLOT(setPort1Multitap()));
  connect(system_port1_mouse, SIGNAL(triggered()), this, SLOT(setPort1Mouse()));
  connect(system_port2_none, SIGNAL(triggered()), this, SLOT(setPort2None()));
  connect(system_port2_gamepad, SIGNAL(triggered()), this, SLOT(setPort2Gamepad()));
  connect(system_port2_asciipad, SIGNAL(triggered()), this, SLOT(setPort2Asciipad()));
  connect(system_port2_multitap, SIGNAL(triggered()), this, SLOT(setPort2Multitap()));
  connect(system_port2_mouse, SIGNAL(triggered()), this, SLOT(setPort2Mouse()));
  connect(system_port2_superscope, SIGNAL(triggered()), this, SLOT(setPort2SuperScope()));
  connect(system_port2_justifier, SIGNAL(triggered()), this, SLOT(setPort2Justifier()));
  connect(system_port2_justifiers, SIGNAL(triggered()), this, SLOT(setPort2Justifiers()));
  connect(system_exit, SIGNAL(triggered()), this, SLOT(quit()));
  connect(settings_videoMode_1x, SIGNAL(triggered()), this, SLOT(setVideoMode1x()));
  connect(settings_videoMode_2x, SIGNAL(triggered()), this, SLOT(setVideoMode2x()));
  connect(settings_videoMode_3x, SIGNAL(triggered()), this, SLOT(setVideoMode3x()));
  connect(settings_videoMode_4x, SIGNAL(triggered()), this, SLOT(setVideoMode4x()));
  connect(settings_videoMode_5x, SIGNAL(triggered()), this, SLOT(setVideoMode5x()));
  connect(settings_videoMode_correctAspectRatio, SIGNAL(triggered()), this, SLOT(toggleAspectCorrection()));
  connect(settings_videoMode_ntsc, SIGNAL(triggered()), this, SLOT(setVideoNtsc()));
  connect(settings_videoMode_pal, SIGNAL(triggered()), this, SLOT(setVideoPal()));
  if(filter.opened()) {
    connect(settings_videoFilter_configure, SIGNAL(triggered()), this, SLOT(configureFilter()));
    for(unsigned i = 0; i < settings_videoFilter_list.size(); i++) {
      connect(settings_videoFilter_list[i], SIGNAL(triggered()), this, SLOT(setFilter()));
    }
  }
  connect(settings_smoothVideo, SIGNAL(triggered()), this, SLOT(toggleSmoothVideo()));
  connect(settings_muteAudio, SIGNAL(triggered()), this, SLOT(muteAudio()));
  connect(settings_emulationSpeed_slowest, SIGNAL(triggered()), this, SLOT(setSpeedSlowest()));
  connect(settings_emulationSpeed_slow, SIGNAL(triggered()), this, SLOT(setSpeedSlow()));
  connect(settings_emulationSpeed_normal, SIGNAL(triggered()), this, SLOT(setSpeedNormal()));
  connect(settings_emulationSpeed_fast, SIGNAL(triggered()), this, SLOT(setSpeedFast()));
  connect(settings_emulationSpeed_fastest, SIGNAL(triggered()), this, SLOT(setSpeedFastest()));
  connect(settings_emulationSpeed_syncVideo, SIGNAL(triggered()), this, SLOT(syncVideo()));
  connect(settings_emulationSpeed_syncAudio, SIGNAL(triggered()), this, SLOT(syncAudio()));
  connect(settings_configuration, SIGNAL(triggered()), this, SLOT(showConfigWindow()));
  connect(tools_movies_play, SIGNAL(triggered()), this, SLOT(playMovie()));
  connect(tools_movies_stop, SIGNAL(triggered()), this, SLOT(stopMovie()));
  connect(tools_movies_recordFromPowerOn, SIGNAL(triggered()), this, SLOT(recordMovieFromPowerOn()));
  connect(tools_movies_recordFromHere, SIGNAL(triggered()), this, SLOT(recordMovieFromHere()));
  connect(tools_captureScreenshot, SIGNAL(triggered()), this, SLOT(saveScreenshot()));
  connect(tools_debugger, SIGNAL(triggered()), this, SLOT(showDebugger()));
  connect(tools_dialog, SIGNAL(triggered()), this, SLOT(showToolsDialog()));
  connect(help_documentation, SIGNAL(triggered()), this, SLOT(showDocumentation()));
  connect(help_license, SIGNAL(triggered()), this, SLOT(showLicense()));
  connect(help_about, SIGNAL(triggered()), this, SLOT(showAbout()));

  syncUi();
}
void CPetInventoryGlyph::leave() {
	stopMovie();
}
示例#23
0
bool CParrot::FrameMsg(CFrameMsg *msg) {
	if (compareViewNameTo("ParrotLobby.Node 1.N"))
		return false;
	if (_v4)
		return true;

	Point pt = getMousePos();
	CGameObject *dragObject = getDraggingObject();
	int xp = _bounds.left + _bounds.width() / 2;

	if ((_npcFlags & NPCFLAG_400000) && !hasActiveMovie()) {
		_field128 = xp - (_field124 + _bounds.width() / 2);

		if (xp < 64) {
			if (_field134) {
				CActMsg actMsg("PanAwayFromParrot");
				actMsg.execute(_field134);
			}

			_npcFlags &= ~(NPCFLAG_10000 | NPCFLAG_20000 | NPCFLAG_40000
				| NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000 | NPCFLAG_400000);
			return true;
		}
	}

	bool chickenFlag = dragObject && dragObject->isEquals("Chicken");

	if (_npcFlags & NPCFLAG_1000000) {
		if (!chickenFlag || pt.x > 70 || pt.y < 90 || pt.y > 280) {
			stopMovie();
			loadFrame(0);
			setPosition(Point(-90, _bounds.top));
		}
	} else {
		if (!chickenFlag)
			return false;
	}

	_field128 = CLIP((int)pt.x, 230, 480);
	if ((_npcFlags & NPCFLAG_10000) || hasActiveMovie())
		return true;

	if (_field128 > 64) {
		_npcFlags |= NPCFLAG_10000 | NPCFLAG_20000;

		if (_field128 >= xp) {
			setPosition(Point(_bounds.left + 30, _bounds.top));
			_npcFlags |= NPCFLAG_200000;
			playClip("Walk Right Intro", MOVIE_NOTIFY_OBJECT);
		} else {
			_npcFlags |= NPCFLAG_100000;
			playClip("Walk Left Intro", MOVIE_NOTIFY_OBJECT);
		}
	} else if (chickenFlag && pt.y >= 90 && pt.y <= 280 && !_field12C) {
		CParrotTriesChickenMsg triesMsg;
		triesMsg.execute(dragObject);

		CTrueTalkTriggerActionMsg triggerMsg;
		int id;
		switch (triesMsg._value2) {
		case 1:
			id = 280056 + (triesMsg._value1 ? 234 : 0);
			break;
		case 2:
			id = 280055 + (triesMsg._value1 ? 234 : 0);
			break;
		case 3:
			id = 280054 + (triesMsg._value1 ? 234 : 0);
			break;
		default:
			id = 280053 + (triesMsg._value1 ? 234 : 0);
			break;
		}

		if (id < 280266) {
			if (pt.x < 75) {
				_npcFlags |= NPCFLAG_1000000;
				playClip("Walk Left Intro", MOVIE_STOP_PREVIOUS);
				playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
				movieEvent(236);
				chickenFlag = false;
			} else if ((pt.x - xp) > 15) {
				_npcFlags |= NPCFLAG_800000;
				playClip("Peck At Feet Right", MOVIE_NOTIFY_OBJECT);
				movieEvent(170);
			} else if ((xp - pt.x) > 15) {
				_npcFlags |= NPCFLAG_800000;
				playClip("Peck At Feet Left", MOVIE_NOTIFY_OBJECT);
				movieEvent(142);
			} else {
				_npcFlags |= NPCFLAG_800000;
				playClip("Peck At Feet", MOVIE_NOTIFY_OBJECT);
				movieEvent(157);
			}
		}

		if (chickenFlag) {
			triggerMsg._param2 = 1;
			triggerMsg.execute(this);
			_field12C = 1;
		}
	}

	return true;
}
示例#24
0
bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
	if ((_npcFlags & NPCFLAG_2000000) && clipExistsByEnd("Take Off", msg->_endFrame)) {
		setVisible(false);
		moveUnder(findRoom());
		stopMovie();

		CActMsg actMsg1("LoseParrot");
		actMsg1.execute("ParrotLobbyController");

		if (_field134) {
			CActMsg actMsg2("PanAwayFromParrot");
			actMsg2.execute(_field134);
			_field134 = nullptr;
		} else {
			CActMsg actMsg2("Shut");
			actMsg2.execute("ParrotCage");
		}

		_npcFlags &= ~NPCFLAG_2000000;
		_v4 = 2;
	} else if (_npcFlags & NPCFLAG_10000) {
		if (_npcFlags & NPCFLAG_20000) {
			_npcFlags = (_npcFlags & ~NPCFLAG_20000) | NPCFLAG_40000;
			if (_npcFlags & NPCFLAG_100000) {
				playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
				movieEvent(236);
			} else {
				playClip("Walk Right Loop", MOVIE_NOTIFY_OBJECT);
			}
		} else if (_npcFlags & NPCFLAG_40000) {
			int xp = _bounds.left + _bounds.width() / 2;

			if (_npcFlags & NPCFLAG_100000) {
				if ((xp - _field128) > 32) {
					setPosition(Point(_bounds.left - 40, _bounds.top));
					playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
					movieEvent(236);
				} else {
					setPosition(Point(_bounds.left - 10, _bounds.top));
					playClip("Walk Left Outro", MOVIE_NOTIFY_OBJECT);
					_npcFlags = (_npcFlags & ~NPCFLAG_40000) | NPCFLAG_80000;
				}
			} else {
				if ((_field128 - xp) > 32) {
					playClip("Walk Right Loop", MOVIE_NOTIFY_OBJECT);
					movieEvent(244);
				} else {
					playClip("Walk Right Outro", MOVIE_NOTIFY_OBJECT);
					_npcFlags = (_npcFlags & NPCFLAG_40000) | NPCFLAG_80000;
				}
			}
		} else if (_npcFlags & NPCFLAG_80000) {
			loadFrame(0);
			if (_npcFlags & NPCFLAG_100000)
				setPosition(Point(_bounds.left - 30, _bounds.top));
			else
				setPosition(Point(_bounds.left + 14, _bounds.top));

			_npcFlags &= ~(NPCFLAG_10000 | NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000);
			CTrueTalkNPC::MovieEndMsg(msg);
		} else {
			if (_npcFlags & NPCFLAG_1000000) {
				Point pt = getMousePos();
				if (pt.x > 70 || pt.y < 90 || pt.y > 280) {
					stopMovie();
					loadFrame(0);
					_npcFlags &= ~NPCFLAG_1000000;
				}

				if (clipExistsByEnd("Walk Left Loop", msg->_endFrame)) {
					playClip("Lean Over To Chicken", MOVIE_NOTIFY_OBJECT);
					setPosition(Point(_bounds.left - 55, _bounds.top));
					_field130 = (-100 - _bounds.left) / 5;
					movieEvent(261);
					movieEvent(262);
					movieEvent(265);
					movieEvent(268);
					movieEvent(271);
					return true;

				} else if (clipExistsByEnd("Lean Over To Chicken", msg->_endFrame)) {
					playClip("Eat Chicken", 0);
					playClip("Eat Chicken 2", MOVIE_NOTIFY_OBJECT);
					_v1 = 1;

					CStatusChangeMsg statusMsg;
					statusMsg._newStatus = 0;
					statusMsg.execute("PerchCoreHolder");

					CTrueTalkTriggerActionMsg actionMsg;
					actionMsg._param1 = 280266;
					actionMsg._param2 = 1;
					actionMsg.execute(this);

					CCarry *chicken = dynamic_cast<CCarry *>(findUnder(getRoot(), "Chicken"));
					if (chicken) {
						CActMsg actMsg("Eaten");
						actMsg.execute(chicken);
					}

					_npcFlags &= ~NPCFLAG_1000000;
					return true;
				}
			}

			if (clipExistsByEnd("Eat Chicken 2", msg->_endFrame)) {
				CStatusChangeMsg statusMsg;
				statusMsg._newStatus = 1;
				statusMsg.execute("PerchCoreHolder");

				if (_v2) {
					loadMovie("z168.avi", false);
					playClip("Take Off", MOVIE_NOTIFY_OBJECT);
					setPosition(Point(20, 10));
					_npcFlags |= NPCFLAG_2000000;
				} else {
					_npcFlags &= ~(NPCFLAG_10000 | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000);
					_npcFlags |= NPCFLAG_400000;
					stopMovie();
					loadFrame(0);
					setPosition(Point(-90, _bounds.top));
				}
			} else {
				CTrueTalkNPC::MovieEndMsg(msg);
			}
		}
	}

	return true;
}
示例#25
0
MainWindow::MainWindow() {
  setObjectName("main-window");
  setWindowTitle(string() << SNES::Info::Name << " v" << SNES::Info::Version);
  setCloseOnEscape(false);
  setGeometryString(&config().geometry.mainWindow);
  application.windowList.append(this);

  //menu bar
  #if defined(PLATFORM_OSX)
  menuBar = new QMenuBar(0);
  #else
  menuBar = new QMenuBar;
  #endif

  system = menuBar->addMenu("&System");

  system_load = system->addAction("Load &Cartridge ...");

  system_loadSpecial = system->addMenu("Load &Special");

  system_loadSpecial_bsx = system_loadSpecial->addAction("Load &BS-X Cartridge ...");
  
  system_loadSpecial_bsxSlotted = system_loadSpecial->addAction("Load BS-X &Slotted Cartridge ...");

  system_loadSpecial_sufamiTurbo = system_loadSpecial->addAction("Load Sufami &Turbo Cartridge ...");

  system_loadSpecial_superGameBoy = system_loadSpecial->addAction("Load Super &Game Boy Cartridge ...");

  system_saveMemoryPack = system->addAction("Save Memory Pack ...");
  system_saveMemoryPack->setVisible(false);

  system_reload = system->addAction("Re&load");

  system->addSeparator();

  system->addAction(system_power = new CheckAction("&Power", 0));

  system_reset = system->addAction("&Reset");

  system->addSeparator();

  system_port1 = system->addMenu("Controller Port &1");
  system_port1->addAction(system_port1_none = new RadioAction("&None", 0));
  system_port1->addAction(system_port1_gamepad = new RadioAction("&Gamepad", 0));
  system_port1->addAction(system_port1_asciipad = new RadioAction("&asciiPad", 0));
  system_port1->addAction(system_port1_multitap = new RadioAction("&Multitap", 0));
  system_port1->addAction(system_port1_mouse = new RadioAction("&Mouse", 0));
  system_port1->addAction(system_port1_nttdatakeypad = new RadioAction("NTT Data &Keypad", 0));

  system_port2 = system->addMenu("Controller Port &2");
  system_port2->addAction(system_port2_none = new RadioAction("&None", 0));
  system_port2->addAction(system_port2_gamepad = new RadioAction("&Gamepad", 0));
  system_port2->addAction(system_port2_asciipad = new RadioAction("&asciiPad", 0));
  system_port2->addAction(system_port2_multitap = new RadioAction("&Multitap", 0));
  system_port2->addAction(system_port2_mouse = new RadioAction("&Mouse", 0));
  system_port2->addAction(system_port2_superscope = new RadioAction("&Super Scope", 0));
  system_port2->addAction(system_port2_justifier = new RadioAction("&Justifier", 0));
  system_port2->addAction(system_port2_justifiers = new RadioAction("Two &Justifiers", 0));

  #if !defined(PLATFORM_OSX)
  system->addSeparator();
  #endif

  system_exit = system->addAction("E&xit");
  system_exit->setMenuRole(QAction::QuitRole);

  settings = menuBar->addMenu("S&ettings");

  settings_videoMode = settings->addMenu("Video &Mode");

  settings_videoMode->addAction(settings_videoMode_1x = new RadioAction("Scale &1x", 0));

  settings_videoMode->addAction(settings_videoMode_2x = new RadioAction("Scale &2x", 0));

  settings_videoMode->addAction(settings_videoMode_3x = new RadioAction("Scale &3x", 0));

  settings_videoMode->addAction(settings_videoMode_4x = new RadioAction("Scale &4x", 0));

  settings_videoMode->addAction(settings_videoMode_5x = new RadioAction("Scale &5x", 0));

  settings_videoMode->addAction(settings_videoMode_max_normal = new RadioAction("Scale Max - &Normal", 0));

  settings_videoMode->addAction(settings_videoMode_max_wide = new RadioAction("Scale Max - &Wide", 0));

  settings_videoMode->addAction(settings_videoMode_max_wideZoom = new RadioAction("Scale Max - Wide &Zoom", 0));

  settings_videoMode->addSeparator();

  settings_videoMode->addAction(settings_videoMode_correctAspectRatio = new CheckAction("Correct &Aspect Ratio", 0));

  settings_videoMode->addSeparator();

  settings_videoMode->addAction(settings_videoMode_ntsc = new RadioAction("&NTSC", 0));
  settings_videoMode->addAction(settings_videoMode_pal = new RadioAction("&PAL", 0));

  if(filter.opened()) {
    settings_videoFilter = settings->addMenu("Video &Filter");

    settings_videoFilter_configure = settings_videoFilter->addAction("&Configure Active Filter ...");
    settings_videoFilter->addSeparator();

    settings_videoFilter->addAction(settings_videoFilter_none = new RadioAction("&None", 0));
    settings_videoFilter_list.append(settings_videoFilter_none);

    lstring filterlist;
    filterlist.split(";", filter.dl_supported());
    for(unsigned i = 0; i < filterlist.size(); i++) {
      RadioAction *action = new RadioAction(filterlist[i], 0);
      settings_videoFilter->addAction(action);
      settings_videoFilter_list.append(action);
    }
  }

  settings->addAction(settings_smoothVideo = new CheckAction("&Smooth Video Output", 0));

  settings->addSeparator();

  settings->addAction(settings_muteAudio = new CheckAction("&Mute Audio Output", 0));

  settings->addSeparator();

  settings_emulationSpeed = settings->addMenu("Emulation &Speed");

  settings_emulationSpeed->addAction(settings_emulationSpeed_slowest = new RadioAction("Slowest", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_slow = new RadioAction("Slow", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_normal = new RadioAction("Normal", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_fast = new RadioAction("Fast", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_fastest = new RadioAction("Fastest", 0));

  settings_emulationSpeed->addSeparator();

  settings_emulationSpeed->addAction(settings_emulationSpeed_syncVideo = new CheckAction("Sync &Video", 0));

  settings_emulationSpeed->addAction(settings_emulationSpeed_syncAudio = new CheckAction("Sync &Audio", 0));

  settings_configuration = settings->addAction("&Configuration ...");
  settings_configuration->setMenuRole(QAction::PreferencesRole);

  tools = menuBar->addMenu("&Tools");

  tools_movies = tools->addMenu("&Movies");

  tools_movies_play = tools_movies->addAction("Play Movie ...");

  tools_movies_stop = tools_movies->addAction("Stop");

  tools_movies_recordFromPowerOn = tools_movies->addAction("Record Movie (and restart system)");

  tools_movies_recordFromHere = tools_movies->addAction("Record Movie (starting from here)");

  tools_captureScreenshot = tools->addAction("&Capture Screenshot");
  
  tools_captureSPC = tools->addAction("Capture &SPC Dump");

  tools->addSeparator();

  tools_loadState = tools->addMenu("&Load Quick State");
  for(unsigned i = 0; i < 10; i++) {
    QAction *loadAction = new QAction(string("Slot ", i + 1), 0);
    loadAction->setData(i);
    connect(loadAction, SIGNAL(triggered()), this, SLOT(loadState()));
    tools_loadState->addAction(loadAction);
  }

  tools_saveState = tools->addMenu("&Save Quick State");
  for(unsigned i = 0; i < 10; i++) {
    QAction *saveAction = new QAction(string("Slot ", i + 1), 0);
    saveAction->setData(i);
    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveState()));
    tools_saveState->addAction(saveAction);
  }

  tools->addSeparator();

  tools_cheatEditor = tools->addAction("Cheat &Editor ...");

  tools_cheatFinder = tools->addAction("Cheat &Finder ...");

  tools_stateManager = tools->addAction("&State Manager ...");

  tools_effectToggle = tools->addAction("Effect &Toggle ...");
  if(!SNES::PPU::SupportsLayerEnable && !SNES::DSP::SupportsChannelEnable)
    tools_effectToggle->setVisible(false);
  
  tools_manifestViewer = tools->addAction("&Manifest Viewer ...");
  
  tools_soundViewer = tools->addAction("Sound &Viewer ...");

  tools_debugger = tools->addAction("&Debugger ...");
  #if !defined(DEBUGGER)
  tools_debugger->setVisible(false);
  #endif

  help = menuBar->addMenu("&Help");

  help_documentation = help->addAction("&Documentation ...");

  help_license = help->addAction("&License ...");

  #if !defined(PLATFORM_OSX)
  help->addSeparator();
  #endif

  help_about = help->addAction("&About ...");
  help_about->setMenuRole(QAction::AboutRole);

  //canvas
  canvasContainer = new CanvasObject;
  canvasContainer->setAcceptDrops(true); {
    canvasContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    canvasContainer->setObjectName("backdrop");

    canvasLayout = new QVBoxLayout; {
      canvasLayout->setMargin(0);
      canvasLayout->setAlignment(Qt::AlignCenter);

      canvas = new CanvasWidget;
      canvas->setAcceptDrops(true);
      canvas->setFocusPolicy(Qt::StrongFocus);
      canvas->setAttribute(Qt::WA_PaintOnScreen, true);  //disable Qt painting on focus / resize
      canvas->setAttribute(Qt::WA_NoSystemBackground, true);
    }
    canvasLayout->addWidget(canvas);
  }
  canvasContainer->setLayout(canvasLayout);

  //status bar
  statusBar = new QStatusBar;
  statusBar->setSizeGripEnabled(false);
  statusBar->showMessage("");
  systemState = new QLabel;
  statusBar->addPermanentWidget(systemState);

  //layout
  layout = new QVBoxLayout;
  layout->setMargin(0);
  layout->setSpacing(0);
  #if !defined(PLATFORM_OSX)
  layout->addWidget(menuBar);
  #endif
  layout->addWidget(canvasContainer);
  layout->addWidget(statusBar);
  setLayout(layout);

  //cursor hide timer
  cursorTimer = new QTimer(this);
  cursorTimer->setSingleShot(true);
  cursorTimer->setInterval(5*1000);

  //slots
  connect(system_load, SIGNAL(triggered()), this, SLOT(loadCartridge()));
  connect(system_reload, SIGNAL(triggered()), this, SLOT(reloadCartridge()));
  connect(system_loadSpecial_bsxSlotted, SIGNAL(triggered()), this, SLOT(loadBsxSlottedCartridge()));
  connect(system_loadSpecial_bsx, SIGNAL(triggered()), this, SLOT(loadBsxCartridge()));
  connect(system_loadSpecial_sufamiTurbo, SIGNAL(triggered()), this, SLOT(loadSufamiTurboCartridge()));
  connect(system_loadSpecial_superGameBoy, SIGNAL(triggered()), this, SLOT(loadSuperGameBoyCartridge()));
  connect(system_saveMemoryPack, SIGNAL(triggered()), this, SLOT(saveMemoryPack()));
  connect(system_power, SIGNAL(triggered()), this, SLOT(power()));
  connect(system_reset, SIGNAL(triggered()), this, SLOT(reset()));
  connect(system_port1_none, SIGNAL(triggered()), this, SLOT(setPort1None()));
  connect(system_port1_gamepad, SIGNAL(triggered()), this, SLOT(setPort1Gamepad()));
  connect(system_port1_asciipad, SIGNAL(triggered()), this, SLOT(setPort1Asciipad()));
  connect(system_port1_multitap, SIGNAL(triggered()), this, SLOT(setPort1Multitap()));
  connect(system_port1_mouse, SIGNAL(triggered()), this, SLOT(setPort1Mouse()));
  connect(system_port1_nttdatakeypad, SIGNAL(triggered()), this, SLOT(setPort1NTTDataKeypad()));
  connect(system_port2_none, SIGNAL(triggered()), this, SLOT(setPort2None()));
  connect(system_port2_gamepad, SIGNAL(triggered()), this, SLOT(setPort2Gamepad()));
  connect(system_port2_asciipad, SIGNAL(triggered()), this, SLOT(setPort2Asciipad()));
  connect(system_port2_multitap, SIGNAL(triggered()), this, SLOT(setPort2Multitap()));
  connect(system_port2_mouse, SIGNAL(triggered()), this, SLOT(setPort2Mouse()));
  connect(system_port2_superscope, SIGNAL(triggered()), this, SLOT(setPort2SuperScope()));
  connect(system_port2_justifier, SIGNAL(triggered()), this, SLOT(setPort2Justifier()));
  connect(system_port2_justifiers, SIGNAL(triggered()), this, SLOT(setPort2Justifiers()));
  connect(system_exit, SIGNAL(triggered()), this, SLOT(quit()));
  connect(settings_videoMode_1x, SIGNAL(triggered()), this, SLOT(setVideoMode1x()));
  connect(settings_videoMode_2x, SIGNAL(triggered()), this, SLOT(setVideoMode2x()));
  connect(settings_videoMode_3x, SIGNAL(triggered()), this, SLOT(setVideoMode3x()));
  connect(settings_videoMode_4x, SIGNAL(triggered()), this, SLOT(setVideoMode4x()));
  connect(settings_videoMode_5x, SIGNAL(triggered()), this, SLOT(setVideoMode5x()));
  connect(settings_videoMode_max_normal, SIGNAL(triggered()), this, SLOT(setVideoModeMaxNormal()));
  connect(settings_videoMode_max_wide, SIGNAL(triggered()), this, SLOT(setVideoModeMaxWide()));
  connect(settings_videoMode_max_wideZoom, SIGNAL(triggered()), this, SLOT(setVideoModeMaxWideZoom()));
  connect(settings_videoMode_correctAspectRatio, SIGNAL(triggered()), this, SLOT(toggleAspectCorrection()));
  connect(settings_videoMode_ntsc, SIGNAL(triggered()), this, SLOT(setVideoNtsc()));
  connect(settings_videoMode_pal, SIGNAL(triggered()), this, SLOT(setVideoPal()));
  if(filter.opened()) {
    connect(settings_videoFilter_configure, SIGNAL(triggered()), this, SLOT(configureFilter()));
    for(unsigned i = 0; i < settings_videoFilter_list.size(); i++) {
      connect(settings_videoFilter_list[i], SIGNAL(triggered()), this, SLOT(setFilter()));
    }
  }
  connect(settings_smoothVideo, SIGNAL(triggered()), this, SLOT(toggleSmoothVideo()));
  connect(settings_muteAudio, SIGNAL(triggered()), this, SLOT(muteAudio()));
  connect(settings_emulationSpeed_slowest, SIGNAL(triggered()), this, SLOT(setSpeedSlowest()));
  connect(settings_emulationSpeed_slow, SIGNAL(triggered()), this, SLOT(setSpeedSlow()));
  connect(settings_emulationSpeed_normal, SIGNAL(triggered()), this, SLOT(setSpeedNormal()));
  connect(settings_emulationSpeed_fast, SIGNAL(triggered()), this, SLOT(setSpeedFast()));
  connect(settings_emulationSpeed_fastest, SIGNAL(triggered()), this, SLOT(setSpeedFastest()));
  connect(settings_emulationSpeed_syncVideo, SIGNAL(triggered()), this, SLOT(syncVideo()));
  connect(settings_emulationSpeed_syncAudio, SIGNAL(triggered()), this, SLOT(syncAudio()));
  connect(settings_configuration, SIGNAL(triggered()), this, SLOT(showConfigWindow()));
  connect(tools_movies_play, SIGNAL(triggered()), this, SLOT(playMovie()));
  connect(tools_movies_stop, SIGNAL(triggered()), this, SLOT(stopMovie()));
  connect(tools_movies_recordFromPowerOn, SIGNAL(triggered()), this, SLOT(recordMovieFromPowerOn()));
  connect(tools_movies_recordFromHere, SIGNAL(triggered()), this, SLOT(recordMovieFromHere()));
  connect(tools_captureScreenshot, SIGNAL(triggered()), this, SLOT(saveScreenshot()));
  connect(tools_captureSPC, SIGNAL(triggered()), this, SLOT(saveSPC()));
  connect(tools_cheatEditor, SIGNAL(triggered()), this, SLOT(showCheatEditor()));
  connect(tools_cheatFinder, SIGNAL(triggered()), this, SLOT(showCheatFinder()));
  connect(tools_stateManager, SIGNAL(triggered()), this, SLOT(showStateManager()));
  connect(tools_effectToggle, SIGNAL(triggered()), this, SLOT(showEffectToggle()));
  connect(tools_manifestViewer, SIGNAL(triggered()), this, SLOT(showManifestViewer()));
  connect(tools_soundViewer, SIGNAL(triggered()), this, SLOT(showSoundViewer()));
  connect(tools_debugger, SIGNAL(triggered()), this, SLOT(showDebugger()));
  connect(help_documentation, SIGNAL(triggered()), this, SLOT(showDocumentation()));
  connect(help_license, SIGNAL(triggered()), this, SLOT(showLicense()));
  connect(help_about, SIGNAL(triggered()), this, SLOT(showAbout()));

  syncUi();
}