#include <RioMMInterface.h>
Public Slots | |
virtual void | progressChange (int) |
virtual void | play () |
virtual void | pause () |
virtual void | stop () |
virtual void | fastForward () |
virtual void | fastRewind () |
virtual void | info () |
virtual void | sync () |
virtual void | jumpTo () |
virtual void | keywords () |
virtual void | clean () |
void | progressHold () |
void | progressUnHold () |
void | topicSelected (QListViewItem *) |
void | selectBar () |
void | releaseBar () |
void | setWaitMessage () |
Public Member Functions | |
RioMMInterface (ConfigData *) | |
~RioMMInterface () | |
void | initComponents () |
void | closeEvent (QCloseEvent *) |
void | timerEvent (QTimerEvent *) |
bool | isProgressLatch () |
void | buildIndex (QDomDocument) |
int | buildTree (RioMMQListViewItem *, const QDomElement &, QPtrStack< RioMMQListViewItem > *) |
void | buildKeyword (QDomDocument) |
bool | boldIndexes (QString) |
void | resetIndex () |
Data Fields | |
QGridLayout * | main_layout |
QLabel * | lab_block_number |
QLabel * | lab_percentage |
QLabel * | status_bar_text |
QLabel * | status_bar_icon |
QTimer * | status_bar_timer |
int | status_bar_dot_counter |
QHBox * | status_bar |
QSlider * | sli_progress |
QPushButton * | but_play |
QPushButton * | but_pause |
QPushButton * | but_stop |
QPushButton * | but_fast_rewind |
QPushButton * | but_fast_forward |
QPushButton * | but_info |
QPushButton * | but_quit |
QPushButton * | but_sync |
QPushButton * | but_keywords |
RioMMKeywordsDialog * | keywords_dialog |
QPushButton * | but_clean |
CRioMMObject * | p_MMObject |
int | totalSize |
bool | syncOn |
int | syncType |
int | parentID |
string | movieName |
string | moviePath |
string | formTitle |
int | slideNumber |
int | pos |
QFileInfo | fiSyncFile |
int | n_buttons |
int | readtopics |
Protected Member Functions | |
virtual bool | event (QEvent *e) |
Private Member Functions | |
void | updateProgressBar (int) |
Private Attributes | |
unsigned int | lastJump |
bool | progressLatch |
bool | pressBar |
XWindowAttributes | window_attributes |
QListView * | topics |
ConfigData * | config |
bool | b_finalize |
pthread_mutex_t | m_finalize |
Definition at line 86 of file RioMMInterface.h.
RioMMInterface::RioMMInterface | ( | ConfigData * | config | ) |
Definition at line 48 of file RioMMInterface.cpp.
00049 : QMainWindow() 00050 { 00051 unsigned int ind; 00052 this->config = config; 00053 string title = config->getRioMMServer(); 00054 progressLatch = false; 00055 totalSize = 0; 00056 syncOn = config->getRioMMSync(); 00057 syncType = SYNC_NONE; 00058 parentID = config->getRioMMMainWindow(); 00059 this->p_MMObject = NULL; 00060 pos = 0; 00061 topics = NULL; 00062 pressBar = false; 00063 00064 // Dialogo com as palavras da busca por assunto que podem ser selecionadas. 00065 keywords_dialog = NULL; 00066 00067 if( ( ind = title.find_last_of(":") ) <= title.length() ) 00068 { 00069 ind++; 00070 movieName = title.substr( ind, title.length() - ind ); 00071 00072 if( ( ind = movieName.find_last_of("/") ) <= title.length() ) 00073 { 00074 ind++; 00075 movieName = movieName.substr( ind, movieName.length() - ind ); 00076 } 00077 00078 if( ( ind = movieName.find_last_of(".") ) <= movieName.length() ) 00079 movieName = movieName.substr( 0, ind ); 00080 } 00081 00082 if( ( ind = title.find_last_of(".") ) <= title.length() ) 00083 moviePath = title.substr( 0, ind ); 00084 00085 initComponents(); 00086 00087 formTitle = "RioMMClient - " + title; 00088 setCaption( formTitle.c_str() ); 00089 00090 sli_progress->setRange( 0, totalSize ); 00091 sli_progress->setValue( 0 ); 00092 sli_progress->setTracking( false ); 00093 00094 slideNumber = 1; 00095 00096 lastJump = 0; 00097 00098 // Intervalo de tempo que a janela ser� atualizada. 00099 startTimer( 500 ); 00100 00101 // Inicializa a variavel usada para indicar se devemos terminar o cliente. 00102 00103 b_finalize = false; 00104 00105 // Inicializa novo mutex usado para garantir acesso exclusivo a variavel 00106 // b_finalize. 00107 pthread_mutex_init( &m_finalize, NULL ); 00108 }
RioMMInterface::~RioMMInterface | ( | ) |
Definition at line 113 of file RioMMInterface.cpp.
00114 { 00115 // No need to delete child widgets, Qt does it all for us. 00116 00117 // Remove o mutex usado para garantir acesso exclusivo a variavel 00118 // b_finalize. 00119 pthread_mutex_destroy( &m_finalize ); 00120 }
bool RioMMInterface::boldIndexes | ( | QString | indexes | ) |
Definition at line 551 of file RioMMInterface.cpp.
00552 { 00553 int i; 00554 int nindexes; 00555 int posindex; 00556 bool *flagindexes; 00557 bool ok; 00558 RioMMQListViewItem *item; 00559 QListViewItemIterator indexit( topics ); 00560 00561 // Aloca espa�o para o vetor de �ndices. O vetor indicara quais dos �ndices 00562 // devem ser destacados (em negrito com a cor vermelha). 00563 flagindexes = new bool[ readtopics ]; 00564 00565 if( flagindexes == 0 ) 00566 return false; 00567 00568 for( i = 0; i < readtopics; i++ ) 00569 flagindexes[ i ] = false; 00570 00571 // Determina o numero de valores de indexes (separados por virgulas). 00572 nindexes = indexes.contains( ',' ) + 1; 00573 00574 // Verifica quais indices estao presentes em indexes e, para cada um destes 00575 // altera o valor da sua posicao em flagindexes para true (para indicar que 00576 // ele deve ser destacado). 00577 for( i = 0; i < nindexes; i++ ) 00578 { 00579 posindex = indexes.section( ',', i, i ).toInt( &ok ) - 1; 00580 00581 if( !ok ) 00582 { 00583 QMessageBox::critical( 0, "RioMMClient", 00584 "Erro ao converter um dos indices" ); 00585 delete[] flagindexes; 00586 return false; 00587 } 00588 00589 flagindexes[ posindex ] = true; 00590 } 00591 00592 // Percorre a lista de �ndices e muda a cor da fonte para vermelho e o 00593 // estilo para negrito de todos os itens que devem ser selecionados 00594 // (aqueles para os quais a sua posi��o em flagindexes � igual a true). 00595 posindex = 0; 00596 00597 while( ( item = (RioMMQListViewItem *) indexit.current() ) != 0 ) { 00598 00599 if( flagindexes[ posindex ] ) 00600 { 00601 item->setBold( true ); 00602 item->setColor( QColor::QColor( 255, 0, 0 ) ); 00603 item->repaint(); 00604 } 00605 00606 posindex++; 00607 indexit++; 00608 } 00609 00610 delete[] flagindexes; 00611 return true ; 00612 }
void RioMMInterface::buildIndex | ( | QDomDocument | domTree | ) |
Definition at line 675 of file RioMMInterface.cpp.
00676 { 00677 readtopics = 0; 00678 00679 topics = new QListView( centralWidget() ); 00680 topics->setFixedWidth( width() - MARGIN * 2 ); 00681 00682 main_layout->addMultiCellWidget( topics, 2, 2, 0, n_buttons - 1 ); 00683 00684 connect( topics, SIGNAL( pressed( QListViewItem* ) ), this, 00685 SLOT( topicSelected( QListViewItem* ) ) ); 00686 connect( topics, SIGNAL( verticalSliderPressed() ), this, 00687 SLOT( selectBar() ) ); 00688 connect( topics, SIGNAL( verticalSliderReleased() ), this, 00689 SLOT( releaseBar() ) ); 00690 00691 // Div. configuration of the list view. 00692 topics->addColumn( "", 1 ); 00693 topics->setSorting( -1 ); 00694 00695 // O indice deve comecar desabilitado. 00696 topics->setEnabled( false ); 00697 00698 if( syncOn ) 00699 topics->addColumn( "Block", 1 ); // Esta coluna serve apenas para 00700 // sincronizar o v�deo com o index, 00701 // n�o � exibida. 00702 00703 // Get the header information from the DOM. 00704 QDomElement root = domTree.documentElement(); 00705 QDomNode node; 00706 00707 // Create the tree view out of the DOM. 00708 QPtrStack<RioMMQListViewItem> stack; 00709 00710 stack.setAutoDelete( false ); 00711 stack.clear(); 00712 readtopics = buildTree( 0, root, &stack ); 00713 stack.clear(); 00714 00715 // Ajusting Cols. 00716 if( syncOn ) 00717 { 00718 00719 #ifndef USE_QT_GRID 00720 // Adapta��o para a QT 3.1 (usada na GRID) - Esta fun�ao n�o existe na 00721 // biblioteca Qt 3.1 00722 topics->adjustColumn( 1 ); 00723 #endif 00724 00725 int tmp = ( readtopics < MAX_TOPICS_VIEW )? 0:1; 00726 00727 topics->setColumnWidth( 0, width() - 2 * SPACING - tmp * 00728 topics->verticalScrollBar()->sizeHint().width() 00729 - topics->columnWidth( 1 ) - ADJUST_SCROLL ); 00730 } 00731 else 00732 { 00733 int tmp = ( readtopics < MAX_TOPICS_VIEW )? 0:1; 00734 00735 topics->setColumnWidth( 0, width() - 2 * SPACING - tmp * 00736 topics->verticalScrollBar()->sizeHint().width() 00737 - ADJUST_SCROLL ); 00738 } 00739 00740 // Tamanho m�ximo - comporta MAX_TOPICS_VIEW topicos. 00741 if( parentID == 0 ) // parentID == 0 implica riommclient fora do browser. 00742 { 00743 if( readtopics < 3 ) 00744 readtopics = 3; // Menor tamanho do �ndice deve comportar 3 t�picos 00745 // (por est�tica). 00746 00747 if( readtopics < MAX_TOPICS_VIEW ) 00748 setFixedSize( CLIENT_WIDTH, CLIENT_HEIGHT + TOPICS_VBORDER + 00749 TOPIC_HEIGHT * readtopics ); 00750 else 00751 setFixedSize( CLIENT_WIDTH, CLIENT_HEIGHT + TOPICS_VBORDER + 00752 TOPIC_HEIGHT * MAX_TOPICS_VIEW ); 00753 } 00754 else 00755 { 00756 // Adjusting size to fit in browser 00757 XGetWindowAttributes( qt_xdisplay(), parentID, &window_attributes ); 00758 // The 25 pixel decrease considers the extra space needed by the status 00759 // bar 00760 setFixedSize( window_attributes.width, window_attributes.height - 25 ); 00761 } 00762 00763 topics->setHScrollBarMode( QScrollView::Auto ); 00764 topics->show(); 00765 topics->setFixedHeight( height() - MARGIN * 2 - 2 * SPACING - 00766 but_play->sizeHint().height() - 00767 sli_progress->sizeHint().height() ); 00768 00769 }
void RioMMInterface::buildKeyword | ( | QDomDocument | domTree | ) |
Definition at line 647 of file RioMMInterface.cpp.
00648 { 00649 // Bot�o para mostrar o di�logo com as palavras-chave. 00650 but_keywords = new QPushButton( centralWidget() ); 00651 // Bot�o para limpar as sele��es do �ndice (feitas por alguma busca). 00652 but_clean = new QPushButton( centralWidget() ); 00653 // Inicializa os bot�es e os coloca na interface gr�fica. 00654 but_keywords->setText( "Busca por assunto" ); 00655 but_clean->setText( "Limpar" ); 00656 main_layout->addMultiCellWidget( but_keywords, 3, 3, 0, n_buttons - 3 ); 00657 main_layout->addMultiCellWidget( but_clean, 3, 3, n_buttons - 2, 00658 n_buttons - 1 ); 00659 // Eventos usados pelos novos componentes implementados pela nova 00660 // funcionalidade de busca. 00661 connect( but_clean, SIGNAL( clicked() ), this, SLOT( clean() ) ); 00662 connect( but_keywords, SIGNAL( clicked() ), this, SLOT( keywords() ) ); 00663 // Inicializa o estado dos bot�es e depois os mostra na interface gr�fica. 00664 but_keywords->setEnabled( false ); 00665 but_clean->setEnabled( false ); 00666 but_keywords->show(); 00667 but_clean->show(); 00668 // Cria um novo di�logo com as palavras-chaves, e o inicializa com as 00669 // palavras-chaves definidas pela estrutura hier�rquica dada pelo 00670 // par�metro domTree. 00671 keywords_dialog = new RioMMKeywordsDialog( this, "KeywordsWindow", 0 ); 00672 keywords_dialog->Initialize( domTree ); 00673 }
int RioMMInterface::buildTree | ( | RioMMQListViewItem * | parentItem, | |
const QDomElement & | parentElement, | |||
QPtrStack< RioMMQListViewItem > * | stack | |||
) |
Definition at line 771 of file RioMMInterface.cpp.
00774 { 00775 // O uso deste item permite escolher uma cor e o estilo negrito para a 00776 // fonte de cada um dos �ndices (do objeto topics). 00777 RioMMQListViewItem *thisItem = 0; 00778 RioMMQListViewItem *previousItem; 00779 QDomNode node = parentElement.firstChild(); 00780 QString block; 00781 int readtopics = 0; 00782 int recreadtopics = 0; 00783 00784 while( !node.isNull() ) 00785 { 00786 if( node.isElement() && ( node.nodeName() == "main_title" ) ) 00787 topics->setColumnText( 0, node.toElement().text() ); 00788 00789 else if( node.isElement() && ( node.nodeName() == "block" ) ) 00790 { 00791 block = node.toElement().text(); 00792 readtopics++; 00793 00794 // text vem logo apos block no XML. 00795 node = node.nextSibling(); 00796 00797 if( stack->isEmpty() ) 00798 previousItem = parentItem; 00799 else 00800 previousItem = stack->top(); 00801 00802 // Add a new list view item for the outline. 00803 00804 // O uso deste item permite escolher uma cor e um estilho para a 00805 // fonte de cada um dos �ndices. 00806 if( parentItem == 0 ) 00807 thisItem = new RioMMQListViewItem( topics, previousItem, 00808 QColor::QColor( 0, 0, 0 ) ); 00809 else 00810 thisItem = new RioMMQListViewItem( parentItem, previousItem, 00811 QColor::QColor( 0, 0, 0 ) ); 00812 00813 thisItem->setPixmap( 0, QPixmap( (const char **) topic ) ); 00814 thisItem->setOpen( TRUE ); 00815 thisItem->setText( 0, 00816 node.toElement().text().simplifyWhiteSpace() ); 00817 thisItem->setText( 1, block ); 00818 stack->push( thisItem ); 00819 } 00820 00821 else if( node.isElement() && ( node.nodeName() == "ind_item" ) ) 00822 recreadtopics += buildTree( thisItem, node.toElement(), stack ); 00823 00824 node = node.nextSibling(); 00825 } 00826 00827 // Desempilhando os filhos do item atual. 00828 while( stack->top() != thisItem ) 00829 stack->pop(); 00830 00831 return readtopics + recreadtopics; 00832 }
void RioMMInterface::clean | ( | ) | [virtual, slot] |
Definition at line 638 of file RioMMInterface.cpp.
00639 { 00640 // Limpa a sele��o dos �ndices anteriores. 00641 resetIndex(); 00642 // Desabilita o bot�o usado para limpar as sele��es (pois agora nenhum 00643 // �ndice esta selecionado). 00644 but_clean->setEnabled( false ); 00645 }
void RioMMInterface::closeEvent | ( | QCloseEvent * | e | ) |
Definition at line 1011 of file RioMMInterface.cpp.
01012 { 01013 QString aux; 01014 QFile fSyncFile; 01015 QTextStream *tsSyncFile; 01016 01017 signal( SIGCHLD, SIG_IGN ); 01018 signal( SIGINT, SIG_IGN ); 01019 signal( SIGTERM, SIG_IGN ); 01020 signal( SIGHUP, SIG_IGN ); 01021 01022 if( p_MMObject ) 01023 { 01024 if( !but_play->isEnabled() ) 01025 p_MMObject->Stop(); 01026 01027 p_MMObject->Close(); 01028 01029 // Before exit, we must add the final line in the sync file only if the 01030 // user had created one. 01031 if( syncType != SYNC_NONE ) 01032 { 01033 switch( syncType ) 01034 { 01035 case SYNC_BROWSER: 01036 aux = ""; 01037 break; 01038 case SYNC_TGIF: 01039 aux = "}\n"; 01040 break; 01041 } 01042 fSyncFile.setName( fiSyncFile.filePath() ); 01043 if( fSyncFile.open( IO_WriteOnly | IO_Append ) ) 01044 { 01045 tsSyncFile = new QTextStream( &fSyncFile ); 01046 (*tsSyncFile) << aux; 01047 fSyncFile.close(); 01048 } 01049 else 01050 QMessageBox::warning( 0, "riommclient", 01051 "Could not open/write file\n" 01052 + fiSyncFile.filePath() ); 01053 } 01054 } 01055 e->accept(); 01056 }
bool RioMMInterface::event | ( | QEvent * | e | ) | [protected, virtual] |
Definition at line 1109 of file RioMMInterface.cpp.
01110 { 01111 bool status; 01112 int *progress; 01113 PLAYDATA *data; 01114 QCustomEvent *ce = (QCustomEvent *)e; 01115 01116 bool ok; 01117 QString text; 01118 pthread_t tid; 01119 01120 status = false; 01121 switch( ce->type() ) 01122 { 01123 // O evento User, Oriundo da RioMMVideo, informa � interface que um 01124 // bloco terminou de ser tocado. 01125 case QEvent::User: 01126 #ifdef RIO_DEBUG2 01127 RioErr << "event User: played a block" << endl; 01128 #endif 01129 progress = (int *)ce->data(); 01130 01131 // Quando o usu�rio pressionar e mantiver pressionado os bot�es 01132 // fast_forward ou fast_rewind, os mesmos s� podem reexecutar a 01133 // opera��o de avan�ar/retroceder quando bloco que estiver sendo 01134 // tocado terminar, isto �, quando a interface receber o aviso de 01135 // que um bloco acabou de ser tocado (evento User), por isto a 01136 // op��o AutoRepeat � desabilitada nos m�todos fast_forward/ 01137 // fast_rewind e reabilitada aqui neste ponto, que � quando a 01138 // interface recebe o sinal de OK. 01139 but_fast_forward->setAutoRepeat( true ); 01140 but_fast_rewind->setAutoRepeat( true ); 01141 01142 // S� atualizo a barra de progresso se ela n�o estiver sendo 01143 // utilizada. 01144 if( progressLatch == false ) 01145 updateProgressBar( (int)*progress ); 01146 01147 #ifdef RIO_DEBUG2 01148 RioErr << "Finished User event" << endl; 01149 #endif 01150 status = true; 01151 break; 01152 01153 case QEvent::User + 1: 01154 data = (PLAYDATA *)ce->data(); 01155 switch( data->id ) 01156 { 01157 // Setando p_MMObject. Chamado na RioMMClient. 01158 case 0: 01159 // p_MMObject � CRioMMVideo ou CRioMMMp3. 01160 p_MMObject = data->object; 01161 totalSize = data->size; 01162 sli_progress->setRange( 0, totalSize ); 01163 but_play->setEnabled( true ); 01164 break; 01165 01166 // Evento para exibir mensagem na tela. Chamado na commom.cpp. 01167 case 1: 01168 // Mutex usado para garantir que o evento 9 nao sera 01169 // executado antes de fecharmos a caixa de mensagem 01170 //RioErr << "RioMMInterface::event antes do lock no evento 1" 01171 // << endl; 01172 //pthread_mutex_lock( &m_event ); 01173 QMessageBox::critical( 0, *(data->title), *(data->msg) ); 01174 // Depois de a caixa de mensagem ter sido fechada, o evento 01175 // 9 pode ser executado. 01176 //pthread_mutex_unlock( &m_event ); 01177 //RioErr << "RioMMInterface::event depois do lock no evento 1" 01178 // << endl; 01179 break; 01180 } 01181 status = true; 01182 break; 01183 01184 case QEvent::User + 2: 01185 01186 #ifdef RIO_DEBUG2 01187 RioErr << "\t[RioMMInterface] Evento stop() recebido de fora!" 01188 << endl; 01189 #endif 01190 01191 if( p_MMObject ) 01192 stop(); 01193 break; 01194 01195 // Evento que dispara a constru��o e inser��o do index no riommclient. 01196 case QEvent::User + 3: 01197 buildIndex( *((QDomDocument *)(ce->data())) ); 01198 break; 01199 01200 // Evento que dispara o Play. � usado para o PI, pois o play deve ser 01201 // autom�tico. 01202 case QEvent::User + 4: 01203 play(); 01204 break; 01205 01206 // Evento que solicita o password do usu�rio (se necess�rio) e dispara 01207 // a thread Connection da RioMMClient. 01208 case QEvent::User + 5: 01209 // N�o sera solicitada a password para o usu�rio default (guest). 01210 if( strcmp( config->getRioMMUser(), DEFAULTUSER ) == 0) 01211 { 01212 config->setRioMMPassword( encryptPassword( DEFAULTUSER ) ); 01213 } 01214 else 01215 { 01216 do 01217 { 01218 text = QInputDialog::getText( "RioMMClient", 01219 QString( "User: %1\nPassword:" ). 01220 arg( config->getRioMMUser() ), 01221 QLineEdit::Password, 01222 QString::null, &ok ); 01223 // Usu�rio entrou com uma password. 01224 if( ok && !text.isEmpty() ) 01225 { 01226 config->setRioMMPassword( encryptPassword( 01227 text.ascii() ) ); 01228 } 01229 else 01230 { 01231 // Usu�rio pressionou o bot�o "Cancel". 01232 if( !ok ) 01233 exit( -1 ); 01234 01235 // Usu�rio n�o digitou password e clicou no bot�o "Ok". 01236 if( text.isEmpty() ) 01237 QMessageBox::information( this, 01238 "RioMMClient", "You must enter a password." ); 01239 } 01240 01241 // Enquanto o usu�rio n�o digitar a password e clicar no bot�o 01242 // "Ok", a password ser� novamente solicitada. 01243 }while( text.isEmpty() ); 01244 } 01245 01246 //O compilador em modo pedantico reclama do cast abaixo dizendo que 01247 //ao se pode dar um cast de um objeto para uma funcao. 01248 if( pthread_create( &tid, NULL, (func_t)ce->data(), 01249 (void *)config ) != 0 ) 01250 { 01251 qWarning( "[RioMMClient]: Could not create initialize thread" ); 01252 exit( -1 ); 01253 } 01254 01255 break; 01256 01257 // Evento que dispara a constru��o e inser��o das palavras-chave usada 01258 // pela busca por assunto. 01259 case QEvent::User + 6: 01260 buildKeyword( *((QDomDocument *)( ce->data())) ); 01261 break; 01262 01263 #ifdef USE_GRID 01264 // Evento usado para mostrar uma caixa de mensagem. 01265 // (obs: o evento QEvent::User+7 � usado pela outra busca, nas 01266 // transpar�ncias das aulas, que ainda n�o foi integrada ao c�digo). 01267 case QEvent::User + 8: 01268 data = (PLAYDATA *)ce->data(); 01269 switch( data->id ) 01270 { 01271 case 0: // Mostra a caixa de mensagens. 01272 mb_Wait->setCaption( *(data->title) ); 01273 mb_Wait->setText( *(data->msg) ); 01274 mb_Wait->show(); 01275 break; 01276 01277 case 1: // Fecha a caixa de mensagens. 01278 mb_Wait->hide(); 01279 break; 01280 } 01281 break; 01282 #endif 01283 // Novo evento para terminar o cliente caso tenha ocorrido algum erro 01284 // na conexao TCP. 01285 case QEvent::User + 9: 01286 // Recebemos um evento informando que a interface deve ser fechada 01287 // devido a um erro de conexao. Simplesmente faremos o valor da 01288 // variavel b_finalize seja true, para que ao final do evento 01289 // QEvent::User + 1 atualmente em execucao ou a ser executado, a 01290 // interface seja terminada. 01291 pthread_mutex_lock( &m_finalize ); 01292 b_finalize = true; 01293 pthread_mutex_unlock( &m_finalize ); 01294 break; 01295 01296 // Exibir mensagem de carga 01297 case QEvent::User + 10: 01298 status_bar_dot_counter = 0; 01299 setWaitMessage(); 01300 status_bar_icon->setPixmap( QPixmap( (const char **)warning_pixmap ) ); 01301 connect( status_bar_timer, SIGNAL(timeout()), this, SLOT(setWaitMessage())); 01302 status_bar_timer->start( (int)(1500/MAX_MESSAGE_DOTS )); 01303 break; 01304 01305 // Ocultar mensagem de carga 01306 case QEvent::User + 11: 01307 status_bar_text->setText( "" ); 01308 status_bar_icon->setPixmap( QPixmap( "" ) ); 01309 status_bar_timer->stop(); 01310 break; 01311 01312 default: 01313 status = QMainWindow::event( e ); 01314 } 01315 01316 // Verifica se precisamos finalizar a interface. Isso devera ser feito 01317 // somente se o tipo do evento ce->type() for QEvent::User + 1 (o evento 01318 // que mostra uma mensagem) e se b_finalize for true. 01319 if( ce->type() == ( QEvent::User + 1 ) ) 01320 { 01321 pthread_mutex_lock( &m_finalize ); 01322 if( b_finalize ) 01323 { 01324 QApplication::exit( 1 ); 01325 b_finalize = false; 01326 } 01327 pthread_mutex_unlock( &m_finalize ); 01328 } 01329 01330 return status; 01331 }
void RioMMInterface::fastForward | ( | ) | [virtual, slot] |
Definition at line 333 of file RioMMInterface.cpp.
00334 { 00335 #ifndef RIO_EMUL 00336 // A a��o fastforward deve aguardar a execu��o do bloco atual (que est� no 00337 // player)terminar antes de executar um novo forward. Para isto 00338 // desabilitamos a op��o autoRepeat e a reabilitamos t�o logo este evento 00339 // ocorra (QEvent::User). 00340 but_fast_forward->setAutoRepeat( false ); 00341 00342 lastJump = p_MMObject->getCurrentPlayingBlock() + JUMPBLOCKS; 00343 00344 if( lastJump >= (unsigned int)totalSize ) 00345 { 00346 lastJump = totalSize; 00347 p_MMObject->Stop(); 00348 } 00349 else 00350 { 00351 // Abaixo atualizamos a barra de progresso. J� � sabido que esta 00352 // atualiza��o ser� feita na RioMMVideo, mas embora pare�a redundante, 00353 // ela � necess�ria aqui caso o usu�rio resolva manter o bot�o 00354 // fastforward pressionado, pois a linha de c�digo acima (lastJump = 00355 // p_MMObject->getCurrentPlayingBlock() + JUMPBLOCKS;) precisa que a 00356 // barra de progresso esteja atualizada, o que n�o acontece em tempo 00357 // �til quando deixamos que a RioMMVideo a atualize. 00358 updateProgressBar( lastJump ); 00359 00360 // Log do comportamento do usu�rio. 00361 p_MMObject->inputLog( BFFORWARD, lastJump ); 00362 00363 p_MMObject->GoTo( lastJump ); 00364 } 00365 #endif 00366 }
void RioMMInterface::fastRewind | ( | ) | [virtual, slot] |
Definition at line 368 of file RioMMInterface.cpp.
00369 { 00370 #ifndef RIO_EMUL 00371 // A a��o fastrewind deve aguardar a execu��o do bloco atual (que est� no 00372 // player) terminar antes de executar um novo rewind. Para isto 00373 // desabilitamos a op��o autoRepeat e a reabilitamos t�o logo este evento 00374 // ocorra (QEvent::User). 00375 but_fast_rewind->setAutoRepeat( false ); 00376 00377 if( (signed int) p_MMObject->getCurrentPlayingBlock() - JUMPBLOCKS < 0 ) 00378 lastJump = 0; 00379 else 00380 lastJump = p_MMObject->getCurrentPlayingBlock() - JUMPBLOCKS; 00381 00382 // Abaixo atualizamos a barra de progresso. J� � sabido que esta atualiza��o 00383 // ser� feita na RioMMVideo, mas embora pare�a redundante, ela � necess�ria 00384 // aqui caso o usu�rio resolva manter o bot�o fastbackward pressionado, pois 00385 // a linha de c�digo acima (lastJump = Request[ PlayBuffer ].Block - 00386 // JUMPBLOCKS;) precisa que a barra de progresso esteja atualizada, o que 00387 // n�o acontece em tempo �til quando deixamos que a RioMMVideo a atualize. 00388 updateProgressBar( lastJump ); 00389 00390 // Log do comportamento do usu�rio. 00391 p_MMObject->inputLog( BFREWIND, lastJump ); 00392 00393 p_MMObject->GoTo( lastJump ); 00394 #endif 00395 }
void RioMMInterface::info | ( | ) | [virtual, slot] |
Definition at line 397 of file RioMMInterface.cpp.
00398 { 00399 QString aux( "" ); 00400 aux.sprintf( "Version %s\n%s", VERSION, STR_TXT_ABOUT ); 00401 QMessageBox::information( this, STR_TTL_ABOUT, aux ); 00402 }
void RioMMInterface::initComponents | ( | ) |
Definition at line 834 of file RioMMInterface.cpp.
00835 { 00836 QWidget *principal_widget = new QWidget( this ); 00837 00838 n_buttons = 0; 00839 00840 #ifdef USE_GRID 00841 // Cria a caixa de mensagens para ser usada para mostrar mensagens que s�o 00842 // automaticamente fechadas depois de um tempo. 00843 mb_Wait = new QMessageBox( QString( "" ), QString( "" ), 00844 QMessageBox::Information, QMessageBox::NoButton, 00845 QMessageBox::NoButton, QMessageBox::NoButton, 00846 this, "ModelessMessageBox", true, 00847 Qt::WStyle_StaysOnTop + 00848 Qt::WStyle_DialogBorder ); 00849 #endif 00850 00851 main_layout = new QGridLayout( principal_widget, 1, 1, MARGIN, SPACING, 00852 "main_layout" ); 00853 00854 setCentralWidget( principal_widget ); 00855 00856 lab_percentage = new QLabel( centralWidget() ); 00857 lab_percentage->setText( "0%" ); 00858 main_layout->addMultiCellWidget( lab_percentage, 0, 0, 0, 1 ); 00859 00860 sli_progress = new QSlider( centralWidget() ); 00861 sli_progress->setOrientation( QSlider::Horizontal ); 00862 sli_progress->setFocusPolicy( QSlider::NoFocus ); 00863 sli_progress->setEnabled( false ); 00864 00865 but_play = new QPushButton( centralWidget() ); 00866 but_play->setPixmap( QPixmap( (const char **)play_pixmap_data ) ); 00867 main_layout->addWidget( but_play, 1, n_buttons++ ); 00868 00869 but_pause = new QPushButton( centralWidget() ); 00870 but_pause->setPixmap( QPixmap( (const char **)pause_pixmap_data ) ); 00871 main_layout->addWidget( but_pause, 1, n_buttons++ ); 00872 00873 but_stop = new QPushButton( centralWidget() ); 00874 but_stop->setPixmap( QPixmap( (const char **)stop_pixmap_data ) ); 00875 main_layout->addWidget( but_stop, 1, n_buttons++ ); 00876 00877 but_fast_rewind = new QPushButton( centralWidget() ); 00878 but_fast_rewind->setPixmap( QPixmap( 00879 (const char **)fast_rewd_pixmap_data ) ); 00880 main_layout->addWidget( but_fast_rewind, 1, n_buttons++ ); 00881 00882 but_fast_forward = new QPushButton( centralWidget() ); 00883 but_fast_forward->setPixmap( QPixmap( 00884 (const char **)fast_frwd_pixmap_data ) ); 00885 main_layout->addWidget( but_fast_forward, 1, n_buttons++ ); 00886 00887 but_info = new QPushButton( centralWidget() ); 00888 but_info->setPixmap( QPixmap( (const char **)info_pixmap_data ) ); 00889 main_layout->addWidget( but_info, 1, n_buttons++ ); 00890 00891 // If parentID = 0 then it is standalone. 00892 if( parentID == 0 ) 00893 { 00894 but_quit = new QPushButton( centralWidget() ); 00895 but_quit->setPixmap( QPixmap( (const char **)quit_pixmap_data ) ); 00896 main_layout->addWidget( but_quit, 1, n_buttons++ ); 00897 00898 connect( but_quit, SIGNAL( clicked() ), this, SLOT( close() ) ); 00899 } 00900 00901 status_bar = new QHBox( centralWidget() ); 00902 status_bar->setFrameStyle( QFrame::ToolBarPanel ); 00903 main_layout->addMultiCellWidget( status_bar, 3, 3, 0, n_buttons - 1 ); 00904 00905 status_bar_text = new QLabel( status_bar ); 00906 status_bar_text->setText( "" ); 00907 status_bar_text->setAlignment( Qt::AlignLeft ); 00908 status_bar_text->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); 00909 status_bar_icon = new QLabel( status_bar ); 00910 status_bar_icon->setPixmap( QPixmap( "" ) ); 00911 status_bar_icon->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed ); 00912 00913 status_bar_timer = new QTimer(); 00914 status_bar_dot_counter = MAX_MESSAGE_DOTS; 00915 00916 setFixedSize( CLIENT_WIDTH, CLIENT_HEIGHT ); 00917 00918 // If syncOn = true then adds sync button and lab_block_number. 00919 if( syncOn ) 00920 { 00921 QString temp = QString( "0/%1" ).arg( totalSize ); 00922 00923 but_sync = new QPushButton( centralWidget() ); 00924 but_sync->setPixmap( QPixmap( (const char **)sync_pixmap_data ) ); 00925 00926 main_layout->addWidget( but_sync, 1, n_buttons++ ); 00927 00928 connect( but_sync, SIGNAL( clicked() ), this, SLOT( sync() ) ); 00929 00930 lab_block_number = new QLabel( centralWidget() ); 00931 lab_block_number->setText( temp ); 00932 lab_block_number->setAlignment( AlignRight ); 00933 main_layout->addMultiCellWidget( lab_block_number, 0, 0, 00934 n_buttons - 2, n_buttons - 1 ); 00935 00936 main_layout->addMultiCellWidget( sli_progress, 0, 0, 1, 00937 n_buttons - 3 ); 00938 } 00939 else 00940 { 00941 main_layout->addMultiCellWidget( sli_progress, 0, 0, 1, 00942 n_buttons - 1 ); 00943 } 00944 00945 // Signals and slots connections. 00946 connect( but_play, SIGNAL( clicked() ), this, SLOT( play() ) ); 00947 connect( but_pause, SIGNAL( clicked() ), this, SLOT( pause() ) ); 00948 connect( but_stop, SIGNAL( clicked() ), this, SLOT( stop() ) ); 00949 connect( but_fast_forward, SIGNAL( clicked() ), this, 00950 SLOT( fastForward() ) ); 00951 connect( but_fast_rewind, SIGNAL( clicked() ), this, 00952 SLOT( fastRewind() ) ); 00953 connect( but_info, SIGNAL( clicked() ), this, SLOT( info() ) ); 00954 connect( sli_progress, SIGNAL( sliderMoved( int ) ), this, 00955 SLOT( progressChange( int ) ) ); 00956 connect( sli_progress, SIGNAL( sliderPressed() ), this, 00957 SLOT( progressHold() ) ); 00958 connect( sli_progress, SIGNAL( sliderReleased() ), this, 00959 SLOT( progressUnHold() ) ); 00960 00961 // Para que enquanto o bot�o estiver pressionado, o sinal clicked() seja 00962 // emitido a intervalos de tempo regulares. 00963 but_fast_forward->setAutoRepeat( true ); 00964 but_fast_rewind->setAutoRepeat( true ); 00965 00966 // Tab order 00967 setTabOrder( but_play, but_pause ); 00968 setTabOrder( but_pause, but_stop ); 00969 setTabOrder( but_stop, but_fast_rewind ); 00970 setTabOrder( but_fast_rewind, but_fast_forward ); 00971 setTabOrder( but_fast_forward, but_info ); 00972 if( !syncOn && parentID == 0 ) 00973 setTabOrder( but_info, but_quit ); 00974 else if( syncOn && parentID == 0 ) 00975 { 00976 setTabOrder( but_info, but_quit ); 00977 setTabOrder( but_quit, but_sync ); 00978 } 00979 else if( syncOn && parentID > 0 ) 00980 setTabOrder( but_info, but_sync ); 00981 00982 but_play->setEnabled( false ); 00983 but_stop->setEnabled( false ); 00984 but_pause->setEnabled( false ); 00985 but_fast_forward->setEnabled( false ); 00986 but_fast_rewind->setEnabled( false ); 00987 00988 // Adjusting size. 00989 int total_width = n_buttons * but_play->sizeHint().width() + 00990 ( n_buttons - 1 ) * SPACING + 2 * MARGIN; 00991 if( total_width > width() ) 00992 { 00993 int but_width = ( width() - 2 * MARGIN - ( n_buttons - 1 ) * SPACING ) 00994 / n_buttons; 00995 00996 but_play->setFixedWidth( but_width ); 00997 but_stop->setFixedWidth( but_width ); 00998 but_pause->setFixedWidth( but_width ); 00999 but_fast_forward->setFixedWidth( but_width ); 01000 but_fast_rewind->setFixedWidth( but_width ); 01001 but_info->setFixedWidth( but_width ); 01002 01003 if( syncOn ) 01004 but_sync->setFixedWidth( but_width ); 01005 01006 if( parentID == 0 ) 01007 but_quit->setFixedWidth( but_width ); 01008 } 01009 }
bool RioMMInterface::isProgressLatch | ( | ) |
Definition at line 1085 of file RioMMInterface.cpp.
01086 { 01087 return progressLatch; 01088 }
void RioMMInterface::jumpTo | ( | ) | [virtual, slot] |
Definition at line 197 of file RioMMInterface.cpp.
00198 { 00199 #ifdef RIO_DEBUG2 00200 RioErr << "entered jumpTo" << endl; 00201 #endif 00202 lastJump = sli_progress->value(); 00203 00204 // Log de comportamento do usu�rio. 00205 p_MMObject->inputLog( JUMPBAR, lastJump ); 00206 00207 #ifndef RIO_EMUL 00208 if( lastJump < (unsigned int)totalSize ) 00209 p_MMObject->GoTo( lastJump ); 00210 else 00211 stop(); 00212 #endif 00213 00214 #ifdef RIO_DEBUG2 00215 RioErr << "[Interface]: jumping = " << sli_progress->value() 00216 << ", totalSize = " << totalSize << endl; 00217 #endif 00218 }
void RioMMInterface::keywords | ( | ) | [virtual, slot] |
Definition at line 614 of file RioMMInterface.cpp.
00615 { 00616 QString indexes; 00617 00618 // Mostra o di�logo ao usu�rio com as palavras-chave. 00619 if( keywords_dialog->exec() == QDialog::Accepted ) // O usu�rio escolheu 00620 // uma palavra-chave. 00621 { 00622 // Habilita o bot�o usado para limpar as sele��es (pois uma palavra- 00623 // chave foi selecionada). 00624 but_clean->setEnabled( true ); 00625 // Limpa a sele��o dos �ndices anteriores, se algum foi escolhido. 00626 resetIndex(); 00627 // Seleciona os �ndices associados a palavra-chave escolhida pelo 00628 // usu�rio. 00629 indexes = keywords_dialog->indexPositions(); 00630 00631 if( !boldIndexes( indexes ) ) 00632 QMessageBox::critical( this, "Keywords button", "Internal error" ); 00633 00634 } 00635 00636 }
void RioMMInterface::pause | ( | ) | [virtual, slot] |
Definition at line 253 of file RioMMInterface.cpp.
00254 { 00255 // Log do comportamento do usu�rio. 00256 p_MMObject->inputLog( BPAUSE, p_MMObject->getCurrentPlayingBlock() ); 00257 00258 but_play->setEnabled( true ); 00259 but_stop->setEnabled( true ); 00260 but_pause->setEnabled( false ); 00261 but_fast_forward->setEnabled( false ); 00262 but_fast_rewind->setEnabled( false ); 00263 00264 if( topics != NULL ) 00265 topics->setEnabled( false ); 00266 00267 // Desabilita o bot�o para acessar a caixa de di�logo com as palavras-chave 00268 // da busca por assunto, se esta estiver dispon�vel. 00269 if( keywords_dialog != NULL ) 00270 but_keywords->setEnabled( false ); 00271 00272 sli_progress->setEnabled( false ); 00273 00274 setCaption( "Paused" ); 00275 00276 p_MMObject->Pause(); 00277 }
void RioMMInterface::play | ( | ) | [virtual, slot] |
Definition at line 220 of file RioMMInterface.cpp.
00221 { 00222 // Log do comportamento do usu�rio. 00223 p_MMObject->inputLog( BPLAY, p_MMObject->getCurrentPlayingBlock() ); 00224 00225 but_play->setEnabled( false ); 00226 but_stop->setEnabled( true ); 00227 but_pause->setEnabled( true ); 00228 but_fast_forward->setEnabled( true ); 00229 but_fast_rewind->setEnabled( true ); 00230 00231 if( topics != NULL ) 00232 topics->setEnabled( true ); 00233 00234 // Habilita o bot�o para acessar a caixa de di�logo com as palavras-chave 00235 // da busca por assunto, se esta estiver dispon�vel. 00236 if( keywords_dialog != NULL ) 00237 but_keywords->setEnabled( true ); 00238 00239 if( syncOn ) 00240 but_sync->setEnabled( true ); 00241 00242 sli_progress->setEnabled( true ); 00243 00244 if( parentID == 0 ) 00245 but_quit->setEnabled( false ); 00246 00247 setCaption( QString( formTitle.c_str() ) ); 00248 00249 lastJump = 0; 00250 p_MMObject->Play(); 00251 }
void RioMMInterface::progressChange | ( | int | value | ) | [virtual, slot] |
Definition at line 135 of file RioMMInterface.cpp.
00136 { 00137 #ifdef RIO_DEBUG2 00138 RioErr << "Moved progress bar, called progressChange" << endl; 00139 #endif 00140 ldiv_t result = ldiv( value * 100, totalSize ); 00141 QString temp = QString( "%1%" ).arg( result.quot ); 00142 00143 if( lab_percentage->text() != temp ) 00144 lab_percentage->setText( temp ); 00145 00146 if( syncOn ) 00147 { 00148 #ifdef RIO_DEBUG2 00149 RioErr << "sync mode activated" << endl; 00150 #endif 00151 temp = QString( "%1/%2" ).arg( value ).arg( totalSize ); 00152 lab_block_number->setText( temp ); 00153 } 00154 00155 if( topics != NULL ) 00156 { 00157 #ifdef RIO_DEBUG2 00158 RioErr << "topics != NULL" << endl; 00159 #endif 00160 QListViewItemIterator it( topics ); 00161 while( it.current() && ( it.current()->text( 1 ).toInt() <= value ) ) 00162 it++; 00163 00164 if( it.current() ) 00165 { 00166 #ifdef RIO_DEBUG2 00167 RioErr << "topic found" << endl; 00168 #endif 00169 it--; 00170 if( !topics->isSelected( it.current() ) && !pressBar ) 00171 topics->ensureItemVisible( it.current() ); 00172 00173 topics->setSelected( it.current(), 1 ); 00174 } 00175 else 00176 { 00177 #ifdef RIO_DEBUG2 00178 RioErr << "topic not found - select last" << endl; 00179 #endif 00180 if( !topics->isSelected( topics->lastItem() ) && !pressBar ) 00181 topics->ensureItemVisible( topics->lastItem() ); 00182 00183 topics->setSelected( topics->lastItem(), 1 ); 00184 } 00185 } 00186 00187 // Atualiza vari�vel que indica qual bloco est� sendo tocado. 00188 // � usado no sincronismo de transpar�ncias. 00189 pos = value; 00190 #ifdef RIO_DEBUG2 00191 RioErr << "Finished progressChange" << endl; 00192 #endif 00193 }
void RioMMInterface::progressHold | ( | ) | [slot] |
Definition at line 1074 of file RioMMInterface.cpp.
01075 { 01076 progressLatch = true; 01077 }
void RioMMInterface::progressUnHold | ( | ) | [slot] |
Definition at line 1079 of file RioMMInterface.cpp.
01080 { 01081 progressLatch = false; 01082 jumpTo(); 01083 }
void RioMMInterface::releaseBar | ( | ) | [slot] |
Definition at line 127 of file RioMMInterface.cpp.
00128 { 00129 pressBar = false; 00130 }
void RioMMInterface::resetIndex | ( | ) |
Definition at line 533 of file RioMMInterface.cpp.
00534 { 00535 QListViewItemIterator indexit( topics ); 00536 RioMMQListViewItem *listitem; 00537 00538 // Percorre toda a lista com os �ndices (a topics) e, para cada um destes 00539 // �ndices, desabilita o estilo em negrito e altera a cor da fonte para 00540 // a cor preta. 00541 while( ( listitem = (RioMMQListViewItem *) indexit.current() ) != 0 ) 00542 { 00543 listitem->setBold( false ); 00544 listitem->setColor( QColor::QColor( 0, 0, 0 ) ); 00545 listitem->repaint(); 00546 indexit++; 00547 } 00548 00549 }
void RioMMInterface::selectBar | ( | ) | [slot] |
Definition at line 122 of file RioMMInterface.cpp.
00123 { 00124 pressBar = true; 00125 }
void RioMMInterface::setWaitMessage | ( | ) | [slot] |
Definition at line 1090 of file RioMMInterface.cpp.
01091 { 01092 QString message = "Loading "; 01093 for( int i = 0; i < status_bar_dot_counter; i++ ) 01094 message += "."; 01095 status_bar_dot_counter++; 01096 if( status_bar_dot_counter > MAX_MESSAGE_DOTS ) 01097 status_bar_dot_counter = 1; 01098 status_bar_text->setText( message ); 01099 }
void RioMMInterface::stop | ( | ) | [virtual, slot] |
Definition at line 279 of file RioMMInterface.cpp.
00280 { 00281 #ifdef RIO_DEBUG2 00282 RioErr << "[RioMMInterface] Entrei na stop()..." << endl; 00283 #endif 00284 00285 if( !but_stop->isEnabled() ) 00286 return; 00287 00288 // Log do comportamento do usu�rio. 00289 p_MMObject->inputLog( STOP, p_MMObject->getCurrentPlayingBlock() ); 00290 00291 but_play->setEnabled( true ); 00292 but_stop->setEnabled( false ); 00293 but_pause->setEnabled( false ); 00294 but_fast_forward->setEnabled( false ); 00295 but_fast_rewind->setEnabled( false ); 00296 00297 if( topics != NULL ) 00298 { 00299 topics->setEnabled( false ); 00300 topics->clearSelection(); 00301 } 00302 00303 // Desabilita o bot�o para acessar a caixa de di�logo com as palavras-chave 00304 // da busca por assunto, se esta estiver dispon�vel. 00305 if( keywords_dialog != NULL ) 00306 but_keywords->setEnabled( false ); 00307 00308 if( syncOn ) 00309 but_sync->setEnabled( false ); 00310 00311 sli_progress->setEnabled( false ); 00312 00313 if( parentID == 0 ) 00314 but_quit->setEnabled( true ); 00315 00316 setCaption( QString( formTitle.c_str() ) ); 00317 00318 p_MMObject->Stop(); 00319 00320 // Reinicializando a barra de progresso. 00321 updateProgressBar( 0 ); 00322 00323 if( config->getRioMMAutoPlay() ) 00324 { 00325 close(); 00326 } 00327 00328 #ifdef RIO_DEBUG2 00329 RioErr << "[RioMMInterface] Saindo da stop()..." << endl; 00330 #endif 00331 }
void RioMMInterface::sync | ( | ) | [virtual, slot] |
Definition at line 404 of file RioMMInterface.cpp.
00405 { 00406 QString sFileName; 00407 QStringList slSyncTypes; 00408 bool ok; 00409 00410 RioMMSync *SyncWindow = new RioMMSync( this, "SyncWindow", 0 ); 00411 00412 // Pause video 00413 pause(); 00414 00415 sFileName = movieName.c_str(); 00416 00417 if( syncType == SYNC_NONE ) 00418 { 00419 fiSyncFile.setFile( sFileName + ".browser" ); 00420 if( fiSyncFile.exists() ) 00421 { 00422 syncType = SYNC_BROWSER; 00423 } 00424 else 00425 { 00426 fiSyncFile.setFile( sFileName + ".tgif" ); 00427 if( fiSyncFile.exists() ) 00428 { 00429 syncType = SYNC_TGIF; 00430 } 00431 } 00432 00433 if( syncType == SYNC_NONE ) 00434 { 00435 slSyncTypes.append( "Browser" ); 00436 slSyncTypes.append( "Tgif" ); 00437 slSyncTypes.append( "Choose ..." ); 00438 QString aux = QInputDialog::getItem( "Choosing sync file type", 00439 "Choose sync file type:", 00440 slSyncTypes, 0, false, &ok, 00441 this, "choose_sync" ); 00442 if( ok ) 00443 if( aux == "Browser" ) 00444 { 00445 syncType = SYNC_BROWSER; 00446 fiSyncFile.setFile( (QString)getenv("HOME") + "/" 00447 + sFileName + ".browser" ); 00448 } 00449 else if( aux == "Tgif" ) 00450 { 00451 syncType = SYNC_TGIF; 00452 fiSyncFile.setFile( (QString)getenv("HOME") + "/" 00453 + sFileName + ".tgif" ); 00454 } 00455 else 00456 { 00457 QFileDialog fdSync( NULL, NULL, 0, NULL, false ); 00458 fdSync.setCaption( "Choose sync file" ); 00459 fdSync.addFilter( "Tgif sync files (*.tgif)" ); 00460 fdSync.addFilter( "Html sync files (*.browser)" ); 00461 fdSync.setViewMode( QFileDialog::Detail ); 00462 fdSync.setMode( QFileDialog::ExistingFile ); 00463 00464 if( fdSync.exec() == QDialog::Accepted ) 00465 { 00466 fiSyncFile.setFile( fdSync.selectedFile() ); 00467 if( fiSyncFile.extension() == "browser" ) 00468 syncType = SYNC_BROWSER; 00469 else if( fiSyncFile.extension() == "tgif" ) 00470 syncType = SYNC_TGIF; 00471 } 00472 else 00473 return; 00474 00475 } 00476 else // FIXME Fazer algo melhor, perguntar de novo ao usu�rio? 00477 return; 00478 } 00479 } 00480 fiSyncFile.setCaching( false ); 00481 fiSyncFile.convertToAbs(); 00482 if( SyncWindow->Initialize( fiSyncFile, syncType, pos ) ) 00483 SyncWindow->exec(); 00484 00485 // Continue playing again. 00486 play(); 00487 }
void RioMMInterface::timerEvent | ( | QTimerEvent * | e | ) |
Definition at line 1059 of file RioMMInterface.cpp.
01060 { 01061 if( !but_play->isEnabled() ) 01062 { 01063 sli_progress->update(); 01064 lab_percentage->update(); 01065 01066 if( topics ) 01067 topics->update(); 01068 01069 if( syncOn ) 01070 lab_block_number->update(); 01071 } 01072 }
void RioMMInterface::topicSelected | ( | QListViewItem * | i | ) | [slot] |
Definition at line 489 of file RioMMInterface.cpp.
00490 { 00491 if( !i ) 00492 return; 00493 00494 but_play->setEnabled( false ); 00495 but_stop->setEnabled( true ); 00496 but_pause->setEnabled( true ); 00497 but_fast_forward->setEnabled( true ); 00498 but_fast_rewind->setEnabled( true ); 00499 if( syncOn ) 00500 but_sync->setEnabled( true ); 00501 00502 sli_progress->setEnabled( true ); 00503 00504 if( parentID == 0 ) 00505 but_quit->setEnabled( false ); 00506 00507 lastJump = atoi( i->text( 1 ) ); // Coluna 1 indica o bloco. 00508 #ifndef RIO_EMUL 00509 if( lastJump <= (unsigned int)totalSize ) 00510 { 00511 // Log de comportamento do usu�rio. 00512 p_MMObject->inputLog( JUMPTOPIC, lastJump ); 00513 00514 updateProgressBar( lastJump ); 00515 p_MMObject->GoTo( lastJump ); 00516 00517 // Atualiza vari�vel que indica qual bloco est� sendo tocado. 00518 // � usado no sincronismo de transpar�ncias. 00519 pos = lastJump; 00520 } 00521 else // Avan�ar para bloco inv�lido. 00522 { 00523 QString message = "T�pico pressionado: \n"; 00524 message += i->text( 0 ); 00525 message += tr( "\nImposs�vel exibir bloco " ); 00526 message += i->text( 1 ); 00527 message += tr( "." ); 00528 QMessageBox::critical( 0, "RioMMClient", message ); 00529 } 00530 #endif 00531 }
void RioMMInterface::updateProgressBar | ( | int | progress | ) | [private] |
Definition at line 1103 of file RioMMInterface.cpp.
01104 { 01105 sli_progress->setValue( progress ); 01106 progressChange( progress ); 01107 }
bool RioMMInterface::b_finalize [private] |
Definition at line 105 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_clean |
Definition at line 138 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_fast_forward |
Definition at line 127 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_fast_rewind |
Definition at line 126 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_info |
Definition at line 128 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_keywords |
Definition at line 134 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_pause |
Definition at line 124 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_play |
Definition at line 123 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_quit |
Definition at line 129 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_stop |
Definition at line 125 of file RioMMInterface.h.
QPushButton* RioMMInterface::but_sync |
Definition at line 130 of file RioMMInterface.h.
ConfigData* RioMMInterface::config [private] |
Definition at line 97 of file RioMMInterface.h.
QFileInfo RioMMInterface::fiSyncFile |
Definition at line 160 of file RioMMInterface.h.
string RioMMInterface::formTitle |
Definition at line 157 of file RioMMInterface.h.
Definition at line 136 of file RioMMInterface.h.
QLabel* RioMMInterface::lab_block_number |
Definition at line 115 of file RioMMInterface.h.
QLabel* RioMMInterface::lab_percentage |
Definition at line 116 of file RioMMInterface.h.
unsigned int RioMMInterface::lastJump [private] |
Definition at line 91 of file RioMMInterface.h.
pthread_mutex_t RioMMInterface::m_finalize [private] |
Definition at line 109 of file RioMMInterface.h.
QGridLayout* RioMMInterface::main_layout |
Definition at line 114 of file RioMMInterface.h.
string RioMMInterface::movieName |
Definition at line 155 of file RioMMInterface.h.
string RioMMInterface::moviePath |
Definition at line 156 of file RioMMInterface.h.
Definition at line 161 of file RioMMInterface.h.
Definition at line 150 of file RioMMInterface.h.
Definition at line 154 of file RioMMInterface.h.
Definition at line 159 of file RioMMInterface.h.
bool RioMMInterface::pressBar [private] |
Definition at line 93 of file RioMMInterface.h.
bool RioMMInterface::progressLatch [private] |
Definition at line 92 of file RioMMInterface.h.
Definition at line 165 of file RioMMInterface.h.
QSlider* RioMMInterface::sli_progress |
Definition at line 122 of file RioMMInterface.h.
Definition at line 158 of file RioMMInterface.h.
QHBox* RioMMInterface::status_bar |
Definition at line 121 of file RioMMInterface.h.
Definition at line 120 of file RioMMInterface.h.
QLabel* RioMMInterface::status_bar_icon |
Definition at line 118 of file RioMMInterface.h.
QLabel* RioMMInterface::status_bar_text |
Definition at line 117 of file RioMMInterface.h.
QTimer* RioMMInterface::status_bar_timer |
Definition at line 119 of file RioMMInterface.h.
Definition at line 152 of file RioMMInterface.h.
Definition at line 153 of file RioMMInterface.h.
QListView* RioMMInterface::topics [private] |
Definition at line 95 of file RioMMInterface.h.
Definition at line 151 of file RioMMInterface.h.
XWindowAttributes RioMMInterface::window_attributes [private] |
Definition at line 94 of file RioMMInterface.h.