AudioItem::AudioItem(Audio *aud, ShowFunction *func) : ShowItem(func) , m_audio(aud) , m_previewLeftAction(NULL) , m_previewRightAction(NULL) , m_previewStereoAction(NULL) , m_preview(NULL) { Q_ASSERT(aud != NULL); if (func->color().isValid()) setColor(func->color()); else setColor(ShowFunction::defaultColor(Function::Audio)); calculateWidth(); connect(m_audio, SIGNAL(changed(quint32)), this, SLOT(slotAudioChanged(quint32))); /* Preview actions */ m_previewLeftAction = new QAction(tr("Preview Left Channel"), this); m_previewLeftAction->setCheckable(true); connect(m_previewLeftAction, SIGNAL(toggled(bool)), this, SLOT(slotAudioPreviewLeft(bool))); m_previewRightAction = new QAction(tr("Preview Right Channel"), this); m_previewRightAction->setCheckable(true); connect(m_previewRightAction, SIGNAL(toggled(bool)), this, SLOT(slotAudioPreviewRight(bool))); m_previewStereoAction = new QAction(tr("Preview Stereo Channels"), this); m_previewStereoAction->setCheckable(true); connect(m_previewStereoAction, SIGNAL(toggled(bool)), this, SLOT(slotAudioPreviewStereo(bool))); }
void VideoItem::slotVideoDurationChanged(qint64) { prepareGeometryChange(); calculateWidth(); if (m_function) m_function->setDuration(m_video->totalDuration()); }
void AudioItem::slotAudioChanged(quint32) { prepareGeometryChange(); calculateWidth(); if (m_function) m_function->setDuration(m_audio->totalDuration()); }
VideoItem::VideoItem(Video *vid, ShowFunction *func) : ShowItem(func) , m_video(vid) , m_fullscreenAction(NULL) { Q_ASSERT(vid != NULL); if (func->color().isValid()) setColor(func->color()); else setColor(ShowFunction::defaultColor(Function::Video)); if (func->duration() == 0) func->setDuration(m_video->totalDuration()); calculateWidth(); connect(m_video, SIGNAL(changed(quint32)), this, SLOT(slotVideoChanged(quint32))); connect(m_video, SIGNAL(totalTimeChanged(qint64)), this, SLOT(slotVideoDurationChanged(qint64))); m_fullscreenAction = new QAction(tr("Fullscreen"), this); m_fullscreenAction->setCheckable(true); if (m_video->fullscreen() == true) m_fullscreenAction->setChecked(true); connect(m_fullscreenAction, SIGNAL(toggled(bool)), this, SLOT(slotFullscreenToggled(bool))); }
void overlayText(FILE* outfile ,struct act* myAct , struct meme* myMeme, struct font* myFont, int i){ int height = myFont->myChars[0].h; int totalWidth = 0; double temp = 0; int len = strlen(myAct->ids[i].value); int* widths = (int*) malloc(len * sizeof(int)); int topX = 0, topY = 0, centerX = 0, centerY = 0, k = 0; struct character* charString = (struct character*) calloc(len, sizeof(struct character)); centerX = myAct->ids[i].x; centerY = myAct->ids[i].y; calculateWidth(myAct, myFont, i, &totalWidth, len, charString, widths); temp = (double) totalWidth / 2.0 ; topX = centerX - temp + 1; topY = centerY - height; for ( k = 0; k < len; k++ ) { overlayImages(myMeme->myImage, charString[k].thisChar, topX, topY); topX += widths[k]; } free(widths); free(charString); }
void RGBMatrixItem::slotRGBMatrixChanged(quint32) { prepareGeometryChange(); calculateWidth(); if (m_function) m_function->setDuration(m_matrix->totalDuration()); updateTooltip(); }
void RegisterHandler::setNumberBase(int base) { if (m_base != base) { m_base = base; calculateWidth(); emit reset(); } }
void RegisterHandler::setRegisters(const Registers ®isters) { m_registers = registers; const int size = m_registers.size(); for (int r = 0; r < size; r++) m_registers[r].changed = false; calculateWidth(); reset(); }
RGBMatrixItem::RGBMatrixItem(RGBMatrix *rgbm, ShowFunction *func) : ShowItem(func) , m_matrix(rgbm) { Q_ASSERT(rgbm != NULL); if (func->color().isValid()) setColor(func->color()); else setColor(ShowFunction::defaultColor(Function::RGBMatrixType)); calculateWidth(); connect(m_matrix, SIGNAL(changed(quint32)), this, SLOT(slotRGBMatrixChanged(quint32))); }
EFXItem::EFXItem(EFX *efx, ShowFunction *func) : ShowItem(func) , m_efx(efx) { Q_ASSERT(efx != NULL); if (func->color().isValid()) setColor(func->color()); else setColor(ShowFunction::defaultColor(Function::EFXType)); calculateWidth(); connect(m_efx, SIGNAL(changed(quint32)), this, SLOT(slotEFXChanged(quint32))); }
void RGBMatrixItem::setDuration(quint32 msec, bool stretch) { if (stretch == true) { m_matrix->setTotalDuration(msec); } else { if (m_function) m_function->setDuration(msec); prepareGeometryChange(); calculateWidth(); updateTooltip(); } }
void AudioItem::setTimeScale(int val) { ShowItem::setTimeScale(val); calculateWidth(); }
void RGBMatrixItem::setTimeScale(int val) { ShowItem::setTimeScale(val); calculateWidth(); }
void RGBMatrixItem::slotRGBMatrixChanged(quint32) { prepareGeometryChange(); calculateWidth(); updateTooltip(); }
void EFXItem::slotEFXChanged(quint32) { prepareGeometryChange(); calculateWidth(); updateTooltip(); }
int AMenu::getWidth() const { return _autosize ? calculateWidth() : _width; }