亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? socketserver.cpp

?? Amarok是一款在LINUX或其他類UNIX操作系統中運行的音頻播放器軟件。 經過兩年開發后
?? CPP
字號:
/*************************************************************************** *   Copyright (C) 2004,5 Max Howell <max.howell@methylblue.com>           * *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#define DEBUG_PREFIX "SocketServer"#include "app.h"#include "amarok.h"#include "debug.h"#include "enginebase.h"       //to get the scope#include "enginecontroller.h" //to get the engine#include "statusbar.h"#include <klocale.h>#include <kpopupmenu.h>       //Vis::Selector#include <kprocess.h>         //Vis::Selector#include <kwin.h>             //Vis::Selector#include <kstandarddirs.h>    //locateLocal()#include <qtooltip.h>         //Vis::Selector ctor#include "socketserver.h"#include <sys/socket.h>#include <sys/types.h>#include <sys/un.h>#include <vector>#include <unistd.h>//TODO allow stop/start and pause signals to be sent to registered visualizations//TODO allow transmission of visual data back to us here and allow that to be embedded in stuff//TODO decide whether to use 16 bit integers or 32 bit floats as data sent to analyzers//TODO allow visualizations to determine their own data sizes/// @class Amarok::SocketServerAmarok::SocketServer::SocketServer( const QString &socketName, QObject *parent )        : QServerSocket( parent ){    m_sockfd = ::socket( AF_UNIX, SOCK_STREAM, 0 );    if( m_sockfd == -1 ) {        warning() << "socket() error\n";        return;    }    m_path = locateLocal( "socket", socketName ).local8Bit();    union {        sockaddr_un un;        sockaddr sa;    } local;    local.un.sun_family = AF_UNIX;    qstrcpy( &local.un.sun_path[0], m_path );    ::unlink( m_path ); //FIXME why do we delete it?    if( ::bind( m_sockfd, &local.sa, sizeof(local.un) ) == -1 ) {        warning() << "bind() error\n";        ::close( m_sockfd );        m_sockfd = -1;        return;    }    if( ::listen( m_sockfd, 1 ) == -1 ) {        warning() << "listen() error\n";        ::close( m_sockfd );        m_sockfd = -1;        return;    }    this->setSocket( m_sockfd );}Amarok::SocketServer::~SocketServer(){    if( m_sockfd != -1 )        ::close( m_sockfd );}/// @class Vis::SocketServerVis::SocketServer::SocketServer( QObject *parent )        : Amarok::SocketServer( "amarok.visualization_socket", parent ){}voidVis::SocketServer::newConnection( int sockfd ){    debug() << "Connection requested: " << sockfd << endl;    new SocketNotifier( sockfd ); //handles its own memory}/// @class Vis::SocketNotifierVis::SocketNotifier::SocketNotifier( int sockfd )        : QSocketNotifier( sockfd, QSocketNotifier::Read, this ){    connect( this, SIGNAL(activated( int )), SLOT(request( int )) );}voidVis::SocketNotifier::request( int sockfd ) //slot{    char buf[16]; //TODO docs should state request commands can only be 16 bytes    int nbytes = recv( sockfd, buf, 16, 0 );    if( nbytes > 0 )    {        QCString result( buf );        if( result == "REG" )        {            pid_t *pid = reinterpret_cast<pid_t*>(buf + 4);            debug() << "Registration pid: " << *pid << endl;            Vis::Selector::instance()->mapPID( *pid, sockfd );        }        else if( result == "PCM" )        {            const Engine::Scope &scope = EngineController::engine()->scope();            ::send( sockfd, &scope[0], scope.size()*sizeof(int16_t), 0 );        }    }    else {        debug() << "recv() error, closing socket: " << sockfd << endl;        ::close( sockfd );        delete this;    }}/// @class Vis::SelectorVis::Selector*Vis::Selector::instance(){    QWidget *parent = reinterpret_cast<QWidget*>( pApp->playlistWindow() );    QObject *o = parent->child( "Vis::Selector::instance" );    debug() << bool(o == 0) << endl;    return o ? static_cast<Selector*>( o ) : new Selector( parent );}Vis::Selector::Selector( QWidget *parent )        : QListView( parent, "Vis::Selector::instance", Qt::WType_Dialog )        , m_server( new SocketServer( this ) ){    Amarok::OverrideCursor waitcursor;    setCaption( kapp->makeStdCaption( i18n( "Visualizations" ) ) );    // Gives the window a small title bar, and skips a taskbar entry    KWin::setType( winId(), NET::Utility );    KWin::setState( winId(), NET::SkipTaskbar );    setSorting( 0 );    setColumnWidthMode( 0, QListView::Maximum );    QToolTip::add( viewport(), i18n( "Right-click on item for context menu" ) );    addColumn( QString() );    addColumn( QString() );    reinterpret_cast<QWidget*>(header())->hide();     connect( this, SIGNAL(contextMenuRequested( QListViewItem*, const QPoint&, int )),              this, SLOT(rightButton( QListViewItem*, const QPoint&, int )) );    // Can I get a pointer to the data section of a QCString?    char str[4096];    FILE* vis = popen( "amarok_libvisual --list", "r" );    str[ fread( static_cast<void*>( str ), sizeof(char), 4096, vis ) ] = '\0';    pclose( vis );    const QStringList entries = QStringList::split( '\n', QString::fromLocal8Bit( str ) );    for( QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it )        new Item( this, "amarok_libvisual", *it, "libvisual" );    resize( sizeHint() + QSize(20,0) );    // Center the widget on screen    move( parentWidget()->width()/2 - width()/2, parentWidget()->height()/2 - height()/2 );}voidVis::Selector::processExited( KProcess *proc ){    for( Item *item = static_cast<Item*>( firstChild() ); item; item = static_cast<Item*>( item->nextSibling() ) )        if( item->m_proc == proc )            item->setOn( false ); //will delete m_proc via stateChange( bool )}// Shouldn't be necessary, but it's part of a fix to make libvisual work again when running with amarok binaryvoidVis::Selector::receivedStdout( KProcess */*proc*/, char* buffer, int length ){     debug() << QString::fromLatin1( buffer, length ) << endl;}voidVis::Selector::mapPID( int pid, int sockfd ){    //TODO if we don't find the PID, request process plugin so we can assign the correct checkitem    for( Item *item = static_cast<Item*>( firstChild() ); item; item = static_cast<Item*>( item->nextSibling() ) )        if( item->m_proc && item->m_proc->pid() == pid )        {            item->m_sockfd = sockfd;            return;        }    debug() << "No matching pid in the Vis::Selector!\n";}voidVis::Selector::rightButton( QListViewItem* qitem, const QPoint& pos, int ){    //TODO if the vis is not running it cannot be configured and you shouldn't show the popupmenu!    if( !qitem )        return;    Item *item = static_cast<Item*>( qitem );    KPopupMenu menu( this );    menu.insertItem( i18n( "Fullscreen" ), 0 );    if( !item->m_proc || !item->m_proc->isRunning() )        menu.setItemEnabled( 0, false );    switch( menu.exec( pos ) ) {        case 0: ::send( item->m_sockfd, "fullscreen", 11, 0 ); break;        default: break;    }}#include <qpainter.h>#include <qsimplerichtext.h>voidVis::Selector::viewportPaintEvent( QPaintEvent *e ){    if( childCount() == 0 ) {        //TODO the right message if amarok_libvisual is present but libvisual isn't        hide();        Amarok::StatusBar::instance()->longMessage( i18n(                "<div align=center>"                "<h3>No Visualizations Found</h3>"                "Possible reasons:"                "<ul>"                "<li>libvisual is not installed</li>"                "<li>No libvisual plugins are installed</li>"                "</ul>"                 "Please check these possibilities and restart Amarok."                "</div>" ), KDE::StatusBar::Sorry );    }    else { QListView::viewportPaintEvent( e ); }}/// @class Vis::Selector::ItemVis::Selector::Item::~Item(){    delete m_proc; //kills the process too}voidVis::Selector::Item::stateChange( bool ) //SLOT{    switch( state() ) {    case On:        m_proc = new Amarok::Process();       *m_proc << KStandardDirs::findExe( m_command )               << Selector::instance()->m_server->path()               << text( 0 );        connect( m_proc, SIGNAL(processExited( KProcess* )), listView(), SLOT(processExited( KProcess* )) );        // Shouldn't be necessary, but make visualizations work again when running with amarok binary        connect( m_proc, SIGNAL(receivedStdout (KProcess*, char*, int ) ), listView(), SLOT(receivedStdout (KProcess*, char*, int ) ) );        debug() << "Starting visualization..\n";        if( m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )            break;        //ELSE FALL_THROUGH        warning() << "Could not start " << text( 0 ) << endl;    case Off:        debug() << "Stopping visualization\n";        delete m_proc;        m_proc = 0;        break;    default:        ;    }}#include "socketserver.moc"

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性感一区二区三区| 国产精品资源网站| 99国产欧美久久久精品| 自拍偷拍亚洲欧美日韩| av在线不卡电影| 亚洲欧美视频在线观看| 色婷婷亚洲综合| 视频在线观看一区| 日韩视频免费观看高清完整版| 久久国产生活片100| 久久久久国产免费免费| 成人免费精品视频| 一区二区三区不卡视频在线观看| 91官网在线观看| 日本麻豆一区二区三区视频| 26uuu国产一区二区三区| 岛国精品在线观看| 一级精品视频在线观看宜春院 | 日韩一二三区不卡| 久久国产人妖系列| 国产精品免费久久久久| 欧美在线观看禁18| 免费观看在线综合色| 国产精品丝袜久久久久久app| 色婷婷av一区二区三区大白胸| 日本网站在线观看一区二区三区 | 亚洲一区二区不卡免费| 日韩一区二区三区视频在线| 成人一区二区三区中文字幕| 亚洲一区二区三区自拍| 久久夜色精品国产欧美乱极品| 99riav一区二区三区| 婷婷夜色潮精品综合在线| 国产亚洲1区2区3区| 欧美午夜宅男影院| 国产美女娇喘av呻吟久久| 一区av在线播放| 日本一区二区免费在线观看视频| 日本精品裸体写真集在线观看| 精品一区二区三区久久久| 亚洲欧美日韩成人高清在线一区| 欧美本精品男人aⅴ天堂| 日本韩国精品一区二区在线观看| 国精品**一区二区三区在线蜜桃| 亚洲午夜在线电影| 中文在线资源观看网站视频免费不卡 | 成人性视频免费网站| 天天综合网 天天综合色| 国产欧美日韩综合| 欧美一区二区三区色| 色悠悠久久综合| 国产成+人+日韩+欧美+亚洲| 日韩和欧美一区二区三区| 亚洲免费在线看| 国产偷国产偷亚洲高清人白洁| 8x8x8国产精品| 日本久久精品电影| a美女胸又www黄视频久久| 精品无码三级在线观看视频 | 3atv在线一区二区三区| 91原创在线视频| 福利视频网站一区二区三区| 麻豆精品久久精品色综合| 亚洲mv在线观看| 亚洲免费av在线| 亚洲欧洲一区二区在线播放| 国产人久久人人人人爽| 久久先锋资源网| 欧美精品一区二区三| 91精品国产高清一区二区三区蜜臀 | 成人午夜看片网址| 国内不卡的二区三区中文字幕| 蜜芽一区二区三区| 日本美女一区二区三区视频| 日韩精品免费专区| 丝袜亚洲另类丝袜在线| 天天色图综合网| 图片区日韩欧美亚洲| 五月综合激情网| 亚洲成在人线免费| 性久久久久久久| 五月婷婷久久综合| 日韩av二区在线播放| 日产国产高清一区二区三区| 亚洲电影在线免费观看| 亚洲资源在线观看| 午夜亚洲国产au精品一区二区 | 天天色综合天天| 日本不卡不码高清免费观看| 久久精品国内一区二区三区| 久久国产精品72免费观看| 精品亚洲欧美一区| 成人精品鲁一区一区二区| 波多野洁衣一区| 色综合久久久久综合体桃花网| 欧洲国内综合视频| 91精品国产一区二区三区蜜臀| 日韩亚洲欧美成人一区| 久久人人超碰精品| 国产精品久久久久久久久搜平片 | av在线播放成人| 在线观看av一区二区| 欧美另类z0zxhd电影| 日韩美女视频在线| 国产女人aaa级久久久级 | 午夜日韩在线电影| 毛片基地黄久久久久久天堂| 极品少妇一区二区三区精品视频| 国产不卡免费视频| 91麻豆高清视频| 6080日韩午夜伦伦午夜伦| 精品国产123| 亚洲日本在线观看| 婷婷综合另类小说色区| 国产高清精品久久久久| 欧美在线色视频| 久久久久久久综合日本| 一区二区在线观看av| 理论电影国产精品| bt7086福利一区国产| 欧美一区二区免费观在线| 欧美国产一区二区在线观看| 五月天激情综合| 成人午夜精品在线| 欧美精品粉嫩高潮一区二区| 中文字幕av一区二区三区| 亚洲高清视频的网址| 国产成人精品三级麻豆| 9191成人精品久久| 国产精品美女久久福利网站| 图片区小说区国产精品视频| av在线不卡电影| 精品国产三级a在线观看| 尤物视频一区二区| 国产乱妇无码大片在线观看| 欧美日韩另类一区| 中国av一区二区三区| 日本91福利区| 91激情在线视频| 国产精品麻豆网站| 精品综合免费视频观看| 欧美日韩精品综合在线| 最新不卡av在线| 国产成人免费网站| 日韩欧美中文字幕精品| 亚洲综合久久av| 91麻豆蜜桃一区二区三区| 国产农村妇女毛片精品久久麻豆| 蜜臀久久99精品久久久久宅男| 99久久精品国产精品久久| 国产欧美一区二区三区鸳鸯浴 | 极品少妇一区二区| 91精品免费在线观看| 夜夜亚洲天天久久| 色综合久久综合网欧美综合网| 久久久国际精品| 韩国精品免费视频| 欧美电视剧免费观看| 日韩成人午夜精品| 欧美另类z0zxhd电影| 午夜久久福利影院| 欧美日韩中文国产| 一区二区三区四区乱视频| 91网址在线看| 亚洲日本在线看| 在线视频观看一区| 亚洲综合成人在线视频| 色婷婷国产精品综合在线观看| 中文字幕一区二区在线观看 | 国产露脸91国语对白| 26uuu精品一区二区在线观看| 精品在线观看免费| 精品久久人人做人人爽| 精品一区二区免费| 久久免费视频一区| 成人精品视频一区二区三区尤物| 中文字幕不卡三区| av亚洲精华国产精华精| 亚洲美女视频一区| 欧美图区在线视频| 成人免费视频视频| 国产日韩av一区二区| 成人app在线观看| 一区二区三区中文字幕| 欧美日韩精品一区二区三区四区 | 欧美伦理电影网| 麻豆一区二区在线| 久久久国际精品| av在线综合网| 亚洲二区在线视频| 欧美tk丨vk视频| 成人午夜激情影院| 亚洲一二三四在线观看| 日韩一二三区视频| 福利一区二区在线| 一区二区三区国产豹纹内裤在线| 欧美一卡二卡三卡| 成人少妇影院yyyy| 亚洲一区日韩精品中文字幕| 日韩精品资源二区在线|