SoundPlugin::SoundPlugin(unsigned base, bool bFirst, const char *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; if (bFirst) playSound(getStartUp()); user_data_id = getContacts()->registerUserData(info.title, soundUserData); IconDef icon; icon.name = "sound"; icon.xpm = sound; icon.isSystem = false; Event eIcon(EventAddIcon, &icon); eIcon.process(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, const char *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; if (bFirst) playSound(getStartUp()); user_data_id = getContacts()->registerUserData(info.title, soundUserData); m_bChanged = false; IconDef icon; icon.name = "sound"; icon.xpm = sound; icon.isSystem = false; Event eIcon(EventAddIcon, &icon); eIcon.process(); icon.name = "nosound"; icon.xpm = nosound; eIcon.process(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); CmdSoundDisable = registerType(); EventSoundChanged = registerType(); cmd->id = CmdSoundDisable; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "nosound"; cmd->icon_on = "sound"; cmd->bar_id = ToolBarMain; cmd->bar_grp = 0; cmd->menu_id = 0; cmd->menu_grp = 0; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->icon = NULL; cmd->icon_on = NULL; cmd->bar_id = 0; cmd->menu_id = MenuMain; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, Buffer *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; user_data_id = getContacts()->registerUserData(info.title, soundUserData); m_bChanged = false; CmdSoundDisable = registerType(); EventSoundChanged = registerType(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); cmd->id = CmdSoundDisable; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "nosound"; cmd->icon_on = "sound"; cmd->bar_id = ToolBarMain; cmd->bar_grp = 0; cmd->menu_id = 0; cmd->menu_grp = 0; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->icon = NULL; cmd->icon_on = NULL; cmd->bar_id = 0; cmd->menu_id = MenuMain; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); m_sound = NULL; #ifndef WIN32 m_player = 0; connect(ExecManager::manager, SIGNAL(childExited(int,int)), this, SLOT(childExited(int,int))); #endif m_checkTimer = new QTimer(this); connect(m_checkTimer, SIGNAL(timeout()), this, SLOT(checkSound())); if (bFirst) playSound(getStartUp()); }