void AudioBehaviour::customSetup (map<int,Pixel*>* pixels, vector<Pixel*>* pixelsFast) {
    
	// inicializando el vector de spheric points
	sphericPoints = vector <SphericPoint*> (NUM_POINTS);
	
	// configuración para los primeros 5
	SphericPointConfig _config[] = {
		{true, true, 1.7f, .99f, -180, 540, .6f, .4f, .8f, .35f, .003f, .01f},    // lento, grande, multicolor (graves)
		{true, true, 1.1f, .99f, -180, 540, .7f, .4f, 2.0f, .3f , .005f, .004f},  // medio (medios)
		{true, true, 0.16f, .87f, -180, 540, .7f, .4f, 3.4f, .4f , .008f, .002f}, // medio (medios)
		{true, true, 0.12, .84f, -180, 540, .7f, .4f, 3.8f, .5f , .026f, .0015f},   // rápido, chico, color fijo (agudos)
		{true, true, 1.5f, .79f, -180, 540, .7f, .4f, 3.9f, .6f , .08f, .001f},   // rápido, chico, color fijo (agudos)
	};

	for (int i=0; i<5; i++) {
		sphericPoints [i] = new SphericPoint (RADIUS, _config[i]);
	}
	
	// los 2 últimos con la configuración por defecto (apagados)
	sphericPoints [5] = new SphericPoint (RADIUS);         
	sphericPoints [6] = new SphericPoint (RADIUS);
	
	fade2black = .5;
	fade2blackType = false;

	setBar ();

}
void MusicProgressWidget::initWidget()
{
    m_background = new QLabel(this);
    m_background->setGeometry(20, 20, 360, 115);
    QWidget *backgroundMask = new QWidget(this);
    backgroundMask->setGeometry(20, 45, 360, 90);
    backgroundMask->setStyleSheet("background:rgba(255,255,255,200);");

    QLabel *topTitleName = new QLabel(this);
    topTitleName->setText(tr("Progress Bar"));
    topTitleName->setGeometry(30, 20, 221, 25);
    topTitleName->setStyleSheet("color:#FFFFFF;font-weight:bold;");

    QToolButton *topTitleCloseButton = new QToolButton(this);
    topTitleCloseButton->setGeometry(360, 22, 20, 20);
    topTitleCloseButton->setIcon(QIcon(":/share/searchclosed"));
    topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle03);
    topTitleCloseButton->setEnabled(false);

    m_progressBar = new QProgressBar(this);
    setBar(m_progressBar);
    m_progressBar->setStyleSheet(MusicUIObject::MProgressBar01);

    m_textLabel = new QLabel(this);
    m_textLabel->setAlignment(Qt::AlignCenter);
    m_textLabel->setGeometry(40, 50, 320, 25);
}
Ejemplo n.º 3
0
KRPleaseWait::KRPleaseWait(QString msg, QWidget *parent, int count, bool cancel):
        QProgressDialog(cancel ? 0 : parent) , inc(true)
{
    setModal(!cancel);

    timer = new QTimer(this);
    setWindowTitle(i18n("Krusader::Wait"));

    setMinimumDuration(500);
    setAutoClose(false);
    setAutoReset(false);

    connect(timer, SIGNAL(timeout()), this, SLOT(cycleProgress()));

    QProgressBar* progress = new QProgressBar(this);
    progress->setMaximum(count);
    progress->setMinimum(0);
    setBar(progress);

    QLabel* label = new QLabel(this);
    setLabel(label);

    QPushButton* btn = new QPushButton(i18n("&Cancel"), this);
    setCancelButton(btn);

    btn->setEnabled(canClose = cancel);
    setLabelText(msg);

    show();
}
Ejemplo n.º 4
0
void TFHPBar::clearThis()
{
    if (getBar())
    {
        getBar()->clearAll();
        getBar()->removeFromParentAndCleanup(true);
        setBar(NULL);
    }
}
CheckRepoRootDirPermDialog::CheckRepoRootDirPermDialog(const Account &account,
                                                       const ServerRepo& repo,
                                                       const QString& local_path,
                                                       QWidget *parent)
    : QProgressDialog(parent),
      account_(account),
      repo_(repo),
      local_path_(local_path),
      has_write_perm_(false)
{
    // Here we use the data manager class to fetch the dir instead of doing it
    // directly, because DataManager class would make use of the shared
    // in-memory dirents cache.
    data_mgr_ = seafApplet->dataManager();

    setWindowModality(Qt::WindowModal);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setWindowIcon(QIcon(":/images/seafile.png"));

    QVBoxLayout *layout_ = new QVBoxLayout;
    progress_bar_ = new QProgressBar;
    description_label_ = new QLabel;

    layout_->addWidget(description_label_);
    layout_->addWidget(progress_bar_);

    QHBoxLayout *hlayout_ = new QHBoxLayout;
    more_details_label_ = new QLabel;
    more_details_label_->setText(tr("Checking Permission"));
    QPushButton *cancel_button_ = new QPushButton(tr("Cancel"));
    QWidget *spacer = new QWidget;
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

    hlayout_->addWidget(more_details_label_);
    hlayout_->addWidget(spacer);
    hlayout_->addWidget(cancel_button_);
    hlayout_->setContentsMargins(-1, 0, -1, 6);
    layout_->setContentsMargins(-1, 0, -1, 6);
    layout_->addLayout(hlayout_);

    setLayout(layout_);
    setLabel(description_label_);
    setBar(progress_bar_);
    setCancelButton(cancel_button_);

    data_mgr_notify_ = new DataManagerNotify(repo_.id);
    connect(data_mgr_notify_, SIGNAL(getDirentsSuccess(bool, const QList<SeafDirent>&)),
            this, SLOT(onGetDirentsSuccess(bool)));
    connect(data_mgr_notify_, SIGNAL(getDirentsFailed(const ApiError&)),
            this, SLOT(onGetDirentsFailed()));

    setValue(minimum());
    QTimer::singleShot(0, this, SLOT(checkPerm()));
}
TimedDialog::TimedDialog(const QString &title, const QString &labelText, int timeout, QWidget *parent, Qt::WindowFlags flags) :
    QProgressDialog(labelText, tr("Cancel"), 0, timeout, parent, flags), bar(new QProgressBar(this))
{
    setWindowTitle(title);
    setAutoReset(false);
    // open immediately...
    setMinimumDuration(0);
    // setup progress bar
    bar->setRange(0, timeout);
    bar->setFormat(tr("Timing out in %1 seconds").arg(timeout));
    setBar(bar);
}
UpdaterDialog::UpdaterDialog() :
QProgressDialog("", tr("Cancel"), 0, 0)
{
  setWindowTitle(tr("Updater - Lightscreen"));
  setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
  setAutoClose(false);

  QProgressBar *bar = new QProgressBar(this);
  bar->setTextVisible(false);
  bar->setRange(0, 0);

  QLabel *label = new QLabel(tr("Checking for updates"), this);
  connect(label, SIGNAL(linkActivated(QString)), this, SLOT(link(QString)));

  setLabel(label);
  setBar(bar);
}
Ejemplo n.º 8
0
UpdaterDialog::UpdaterDialog(QWidget *parent) :
    QProgressDialog("", tr("Cancel"), 0, 0, parent)
{
    setWindowTitle(tr("Updater - Lightscreen"));
    setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
    setAutoClose(false);

    QProgressBar *bar = new QProgressBar(this);
    bar->setTextVisible(false);
    bar->setRange(0, 0);

    QLabel *label = new QLabel(tr("Checking for updates..."), this);
    connect(label, &QLabel::linkActivated, this, &UpdaterDialog::link);

    setLabel(label);
    setBar(bar);
}
Ejemplo n.º 9
0
Kleo::ProgressDialog::ProgressDialog(Job *job, const QString &baseText,
                                     QWidget *creator, const char *name, WFlags f)
    : QProgressDialog(creator, name, false, f), mBaseText(baseText)
{
    assert(job);
    setBar(new ProgressBar(this, "replacement progressbar in Kleo::ProgressDialog"));

    setMinimumDuration(2000 /*ms*/);
    setAutoReset(false);
    setAutoClose(false);
    setLabelText(baseText);
    setProgress(0, 0);   // activate busy indicator

    connect(job, SIGNAL(progress(const QString &, int, int)),
            SLOT(slotProgress(const QString &, int, int)));
    connect(job, SIGNAL(done()), SLOT(slotDone()));
    connect(this, SIGNAL(canceled()),
            job, SLOT(slotCancel()));

    QTimer::singleShot(minimumDuration(), this, SLOT(forceShow()));
}
Ejemplo n.º 10
0
bool TFHPBar::init(CCDictionary* pObjectDict)
{
    if (!CSpriteObject::init(pObjectDict))
    {
        return false;
    }
    
    CCString* barFileName = getBarFileNameFromDict();
    
    setBar(dynamic_cast<CScale9SpriteObject*>(OBJECT_FACTORY->createInstance("CScale9SpriteObject")));
    if (!getBar() || !m_pBar->init(barFileName->getCString()))
    {
        return false;
    }
    
    OrigBarSize_ = m_pBar->getSpriteContentSize();
    m_pBar->setSpriteAnchorPoint(ccp(0.f, 0.5f));
  
    addChild(m_pBar);
    m_pBar->attachSpriteTo(m_pBar);

    updateBar();
    return true;
}
Ejemplo n.º 11
0
ProgressDialog::ProgressDialog(const QString &labelText , /*
                               int totalSteps,
                               int showAfter,*/
                               QWidget *parent /*,
                               bool modal*/) :
    QProgressDialog(parent),
//    m_wasVisible(false),
//    m_frozen(false),
//    m_modal(modal),
//    m_minimumTimeHasExpired(false),
//    m_minimumDuration(1000),
//    m_sleepingBetweenOperations(false),
//    m_operationText(""),
//    m_totalSteps(totalSteps),
//    m_deferredClose(false),
    m_indeterminate(false)

{
    RG_DEBUG << "ProgressDialog::ProgressDialog - " << labelText << /* " - modal : " << modal << */ endl;

    setWindowTitle(tr("Rosegarden"));
    setBar(new ProgressBar(this));
    setLabelText(labelText);

    // Setting this to QString() causes the cancel button to be deleted.
    // The cancel buttons have never worked properly, and they are particularly
    // broken now, creating a very tricky plumbing problem.  Not being able to
    // cancel is not ideal, but at least not showing a cancel button is
    // truthful.
    setCancelButtonText(QString());

    setMinimumDuration(2000);
    setAttribute(Qt::WA_DeleteOnClose);
    hide();
//    setModal(modal);
/*    setWindowFlags(Qt::Dialog);

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    layout->setAlignment(Qt::AlignCenter);

    QLabel *info = new QLabel(tr("<qt><h3>Processing...</h3></qt>"));
    layout->addWidget(info);

    QGroupBox *box = new QGroupBox;
    layout->addWidget(box);

    QVBoxLayout *boxLayout = new QVBoxLayout;
    box->setLayout(boxLayout);

    m_label = new QLabel(labelText);
    boxLayout->addWidget(m_label);

    m_progressBar = new ProgressBar(totalSteps);
    boxLayout->addWidget(m_progressBar);

    connect(m_progressBar, SIGNAL(valueChanged(int)),
            this, SLOT(slotCheckShow(int)));

    QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Cancel);
    layout->addWidget(bb);
    bb->setCenterButtons(true);

    connect(bb, SIGNAL(rejected()), this, SLOT(cancel()));
*/
    // don't show before this timer has elapsed
    m_showAfterTimer = new QTimer;
    m_showAfterTimer->setSingleShot(true);
    m_showAfterTimer->start(2000);
    connect(m_showAfterTimer, SIGNAL(timeout()), this, SLOT(forceShow()));

/*
    m_timer = new QTimer;
    m_timer->setSingleShot(true);
    QWidget::hide(); */
}