aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Output/pulseaudio
Commit message (Expand)AuthorAgeFilesLines
* optimized qmake filestrialuser022017-02-111-7/+0
* added Indonesian translation (Wantoyo)trialuser022017-01-032-0/+28
* updated Brazilian Portuguese translation (Vitor Pereira)trialuser022016-08-081-4/+4
* updated .ts filestrialuser022016-06-1926-104/+104
* decreased compiling timetrialuser022016-06-131-2/+4
* cmake: cleanuptrialuser022016-06-031-1/+0
* updated translationstrialuser022016-05-133-6/+6
* building of .app package for MacOS X with CMake (patch by Ivan Ponomarev)trialuser022015-12-041-1/+1
* updated French translation (Sébastien Aperghis-Tramoni)trialuser022015-08-191-5/+5
* updated Polish translation (Daniel Krawczyk)trialuser022015-08-191-1/+1
* updated Greek translation (Dimitrios Glentadakis)trialuser022015-08-111-5/+5
* prepare for Greek translationtrialuser022015-05-232-0/+28
* updated German translation (Ettore Atalan)trialuser022015-04-291-4/+4
* prepare for Bulgarian translationtrialuser022015-04-032-0/+28
* updated Hebrew translation (Genghis Khan)trialuser022015-03-091-1/+1
* renaming experimental branchtrialuser022015-01-092-24/+1
* some fixestrialuser022014-10-201-2/+2
* fixed pulseaudio output regressiontrialuser022014-10-201-1/+1
* pulseaudio: added multichannel supporttrialuser022014-10-082-3/+25
* fixed most output pluginstrialuser022014-10-062-4/+4
* updated Portuguese translation (Sérgio Marques)trialuser022014-09-171-1/+1
* added Portuguese translation (Sérgio Marques)trialuser022014-09-132-0/+28
* removed source language from resourcestrialuser022014-09-121-1/+0
* added source languagetrialuser022014-08-262-0/+28
* removed useless translationstrialuser022014-05-051-27/+0
* updated Hebrew translation (author: Genghis Khan)trialuser022014-04-191-2/+2
* added Serbian translations (author: Mladen Pejaković)trialuser022014-01-064-1/+59
* fixed Galician translation (author: Oscar Pereira)trialuser022013-10-141-4/+4
* added Galician translation (author: Óscar Pereira)trialuser022013-10-042-0/+28
* qmake: removed release option from configtrialuser022013-04-271-2/+1
* fixed buildtrialuser022012-12-071-2/+5
* output api refactoringtrialuser022012-12-074-10/+7
* added Hebrew translation (author: Genghis Khan)trialuser022012-12-012-0/+28
* updated Polish translation (Grzegorz Gibas), fixed cmake scriptstrialuser022012-09-251-5/+5
* added missing qt-linguist files, updated resourcestrialuser022012-08-257-6/+173
* fixed FSF headerstrialuser022012-07-314-4/+4
* fixed FSF address (trunk)trialuser022012-07-314-4/+4
* updated Dutch translation (Ronald Uitermark)trialuser022012-04-061-2/+2
* some volume api changestrialuser022012-03-072-5/+5
* updated copyrightstrialuser022012-01-232-2/+2
* fixed incorrect cflags usagetrialuser022011-10-151-1/+2
* some output plugin api changestrialuser022011-08-062-10/+3
* ixed pulseaudio and jack support, updated Russian translationtrialuser022011-08-031-1/+0
* fixed typostrialuser022011-03-0314-14/+14
* added Spanish translation (author: Félix Medrano)trialuser022010-08-201-5/+5
* added Japanese translation (author: SimaMoto,RyoTa)trialuser022010-08-201-4/+4
* prepare for Spanish translationtrialuser022010-08-203-1/+30
* prepare for Japanese translationtrialuser022010-08-203-1/+30
* added fast seeking patches (Closes issue 338)trialuser022010-07-242-3/+10
* added Dutch translation (author: Ronald ronald645 AT gmail.com)trialuser022010-05-283-1/+31
>updateTabs() { m_rects.clear(); QRect rect; foreach(QString text, m_pl_manager->playListNames()) { if(m_rects.isEmpty()) rect.setX(9); else rect.setX(m_rects.last().right() + m_metrics->width(" | ")); rect.setY(0); rect.setWidth(m_metrics->width(text)); rect.setHeight(m_metrics->ascent ()); m_rects.append(rect); } updateScrollers(); update(); } void PlayListSelector::updateSkin() { loadColors(); drawButtons(); updateTabs(); } void PlayListSelector::renamePlaylist() { bool ok = false; QString name = QInputDialog::getText (this, tr("Rename Playlist"), tr("Playlist name:"), QLineEdit::Normal, m_pl_manager->selectedPlayList()->name(), &ok); if(ok) m_pl_manager->selectedPlayList()->setName(name); } void PlayListSelector::paintEvent(QPaintEvent *) { QPainter painter(this); painter.setFont(m_font); painter.setBrush(QBrush(m_normal_bg)); painter.drawRect(-1,-1,width()+1,height()+1); QStringList names = m_pl_manager->playListNames(); int current = m_pl_manager->indexOf(m_pl_manager->currentPlayList()); int selected = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); painter.setBrush(QBrush(m_selected_bg)); painter.setPen(m_selected_bg); painter.drawRect(m_rects.at(selected).x()- 3 - m_offset, 0, m_rects.at(selected).width()+4, height()-1); for (int i = 0; i < m_rects.size(); ++i) { if(i == current) painter.setPen(m_current); else painter.setPen(m_normal); painter.drawText(m_rects[i].x() - m_offset, m_metrics->ascent(), names.at(i)); if(i < m_rects.size() - 1) { painter.setPen(m_normal); painter.drawText(m_rects[i].x() + m_rects[i].width() - m_offset, m_metrics->ascent(), " | "); } } if(m_scrollable) { painter.drawPixmap(width()-40, 0, m_pixmap); painter.setBrush(QBrush(m_normal_bg)); painter.setPen(m_normal_bg); painter.drawRect(0,0,6,height()); } } void PlayListSelector::mousePressEvent (QMouseEvent *e) { if(m_scrollable && e->x() > width() - 20) { m_offset += m_rects.at(lastVisible()).right() - m_offset - width() + 42; m_offset = qMin(m_offset, m_offset_max); m_right_pressed = true; drawButtons(); update(); return; } if(m_scrollable && (width() - 40 < e->x()) && (e->x() <= width() - 20)) { m_offset -= 11 - m_rects.at(firstVisible()).x() + m_offset; m_offset = qMax(0, m_offset); m_left_pressed = true; drawButtons(); update(); return; } QPoint pp = e->pos(); pp.rx() += m_offset; for(int i = 0; i < m_rects.count(); ++i) { if(m_rects.at(i).contains(pp)) { m_pl_manager->selectPlayList(i); break; } } update(); if(e->button() == Qt::RightButton) m_menu->exec(e->globalPos()); } void PlayListSelector::mouseReleaseEvent (QMouseEvent *e) { m_left_pressed = false; m_right_pressed = false; drawButtons(); update(); QWidget::mouseReleaseEvent(e); } void PlayListSelector::mouseDoubleClickEvent (QMouseEvent *e) { if(e->button() == Qt::LeftButton && !(m_scrollable && (e->x() > width() - 40))) renamePlaylist(); else QWidget::mouseDoubleClickEvent(e); } void PlayListSelector::resizeEvent (QResizeEvent *) { updateScrollers(); } void PlayListSelector::loadColors() { m_normal.setNamedColor(m_skin->getPLValue("normal")); m_current.setNamedColor(m_skin->getPLValue("current")); m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); } void PlayListSelector::drawButtons() { m_pixmap = QPixmap(40, height()); m_pixmap.fill(m_normal_bg); QPainter painter(&m_pixmap); painter.setPen(m_left_pressed ? m_current : m_normal); painter.setBrush(QBrush(m_left_pressed ? m_current : m_normal)); QPoint points[3] = { QPoint(m_pixmap.width() - 25, height()/2 - 5), QPoint(m_pixmap.width() - 35, height()/2-1), QPoint(m_pixmap.width() - 25, height()/2 + 3), }; painter.drawPolygon(points, 3); painter.setPen(m_right_pressed ? m_current : m_normal); painter.setBrush(QBrush(m_right_pressed ? m_current : m_normal)); QPoint points2[3] = { QPoint(m_pixmap.width() - 20, height()/2 - 5), QPoint(m_pixmap.width() - 10, height()/2-1), QPoint(m_pixmap.width() - 20, height()/2 + 3), }; painter.drawPolygon(points2, 3); } void PlayListSelector::updateScrollers() { m_scrollable = m_rects.last().right() > width(); if(m_scrollable) { m_offset_max = m_rects.last().right() - width() + 42; m_offset = qMin(m_offset, m_offset_max); } else { m_offset = 0; m_offset_max = 0; } } int PlayListSelector::firstVisible() { for(int i = 0; i < m_rects.size(); ++i) { if(m_rects.at(i).right() - m_offset + m_metrics->width(" - ") + 2 >= 9) return i; } return 0; } int PlayListSelector::lastVisible() { for(int i = m_rects.size() - 1; i >= 0; --i) { if(m_rects.at(i).x() - m_offset - m_metrics->width(" - ") - 2 <= width() - 40) return i; } return m_rects.count() - 1; }