Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 118610
Collapse All | Expand All

(-)kmplayer-old/src/kmplayerapp.cpp (-59 / +2 lines)
Lines 357-387 Link Here
357
    if (file.exists () && file.open (IO_ReadOnly)) {
357
    if (file.exists () && file.open (IO_ReadOnly)) {
358
        QTextStream ts (&file);
358
        QTextStream ts (&file);
359
        KMPlayer::readXML (m_document, ts, QString::null);
359
        KMPlayer::readXML (m_document, ts, QString::null);
360
    } else {
360
    } 
361
        QString smil = QString::fromLatin1 ("<smil><head><layout>"
362
          "<root-layout width='320' height='240' background-color='black'/>"
363
          "<region id='image1' left='31.25%' top='25%' width='37.5%' height='50%' z-order='1'/>"
364
          "<region id='reg1' top='10%' height='80%' z-order='2'>"
365
          "<region id='image2' left='128' top='136' width='64' bottom='56'/>"
366
          "</region>"
367
          "</layout></head><body><excl><seq>"
368
          "<img src='%1' region='image1' dur='0.5s' fit='fill'/>"
369
          "<par>"
370
          "<animate target='image1' attribute='width' from='37.5%' to='1%' dur='0.5' fill='freeze'/>"
371
          "<animate target='image1' attribute='left' from='31.25%' to='50%' dur='0.5' fill='freeze'/>"
372
          "<animate target='image1' attribute='height' from='50%' to='1%' dur='0.5' fill='freeze'/>"
373
          "<animate target='image1' attribute='top' from='25%' to='50%' dur='0.5' fill='freeze'/>"
374
          "<set target='image1' attribute='background-color' to='white' dur='0.5'/>"
375
          "</par>"
376
          "<par>"
377
          "<animate target='reg1' attribute='background-color' calcMode='discrete' values='#000000;#000000;#020202;#060606;#0B0B0B;#111111;#191919;#222222;#2D2D2D;#393939;#464646;#555555;#656565;#777777;#8A8A8A;#9E9E9E;#B4B4B4;#CCCCCC;#E4E4E4;#FFFFFF' dur='0.6'/>"
378
          "<animate target='image2' attribute='top' from='136' to='72' dur='0.4' fill='freeze'/>"
379
          "<img src='%2' region='image2' dur='0.6' fit='hidden'/>"
380
          "</par></seq><seq begin='reg1.activateEvent'/>"
381
          "</excl></body></smil>").arg (locate ("data", "kmplayer/noise.gif")).arg (KGlobal::iconLoader()->iconPath (QString::fromLatin1 ("kmplayer"), -64));
382
        QTextStream ts (smil.utf8 (), IO_ReadOnly);
383
        KMPlayer::readXML (m_document, ts, QString::null);
384
    }
385
    //m_document->normalize ();
361
    //m_document->normalize ();
386
    m_current = m_document; //mrl->self ();
362
    m_current = m_document; //mrl->self ();
387
    if (m_document && m_document->firstChild ()) {
363
    if (m_document && m_document->firstChild ()) {
Lines 662-701 Link Here
662
};
638
};
663
639
664
KDE_NO_EXPORT void ExitSource::activate () {
640
KDE_NO_EXPORT void ExitSource::activate () {
665
    m_document = new KMPlayer::Document (QString (""), this);
641
    
666
    QString exitfile = locate ("data", "kmplayer/exit.xml");
667
    QFile file (exitfile);
668
    if (file.exists () && file.open (IO_ReadOnly)) {
669
        QTextStream ts (&file);
670
        KMPlayer::readXML (m_document, ts, QString::null);
671
    } else {
672
        QString smil = QString::fromLatin1 ("<smil><head><layout>"
673
          "<root-layout width='320' height='240' background-color='black'/>"
674
          "<region id='reg1' top='10%' height='80%' z-order='2'>"
675
          "<region id='image' left='128' top='72' width='64' bottom='56'/>"
676
          "</region>"
677
          "</layout></head><body>"
678
          "<par>"
679
          "<animate target='reg1' attribute='background-color' calcMode='discrete' values='#FFFFFF;#E4E4E4;#CCCCCC;#B4B4B4;#9E9E9E;#8A8A8A;#777777;#656565;#555555;#464646;#393939;#2D2D2D;#222222;#191919;#111111;#0B0B0B;#060606;#020202;#000000;#000000' dur='0.6'/>"
680
          "<animate target='image' attribute='top' from='72' to='136' dur='0.4' fill='freeze'/>"
681
          "<img src='%2' region='image' dur='0.6' fit='hidden'/>"
682
          "</par>"
683
          "</body></smil>").arg (KGlobal::iconLoader()->iconPath (QString::fromLatin1 ("kmplayer"), -64));
684
        QTextStream ts (smil.utf8 (), IO_ReadOnly);
685
        KMPlayer::readXML (m_document, ts, QString::null);
686
    }
687
    //m_document->normalize ();
688
    m_current = m_document;
689
    if (m_document && m_document->firstChild ()) {
690
        KMPlayer::Mrl * mrl = m_document->firstChild ()->mrl ();
691
        if (mrl) {
692
            setDimensions (m_document->firstChild (), mrl->width, mrl->height);
693
            m_player->updateTree ();
694
            m_current->activate ();
695
            emit startPlaying ();
696
            return;
697
        }
698
    }
699
    qApp->quit ();
642
    qApp->quit ();
700
}
643
}
701
644

Return to bug 118610