Ignore:
Timestamp:
Dec 22, 2011, 6:27:52 PM (14 years ago)
Author:
Silvan Scherrer
Message:

smplayer vendor udate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/myserver.cpp

    r90 r118  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2010 Ricardo Villalba <[email protected]>
     2    Copyright (C) 2006-201 Ricardo Villalba <[email protected]>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    5959        QRegExp rx_function("^(function|f) (.*)");
    6060        QRegExp rx_loadsub("^load_sub (.*)");
    61 
     61        QRegExp rx_playItem("^play item ([0-9]+)");
     62        QRegExp rx_moveItem("^move item ([0-9]+) ([+-]?[0-9]+)");
     63        QRegExp rx_removeItem("^remove item (\\*|[0-9]+)");
     64        QRegExp rx_seek("^seek ([0-9]*\\.*[0-9]*)");
     65        QRegExp rx_get("^get (.*)");
     66        QRegExp rx_setVol("^set volume ([0-9]+)");
    6267
    6368        if (str.toLower() == "hello") {
     
    7378                sendText(" f [function_name]");
    7479                sendText(" open [file]");
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
    7592        }
    7693        else
     
    85102                }
    86103        }
    87         else
     104        else
     105        if (rx_playItem.indexIn(str) > -1) {
     106                QString index = rx_playItem.cap(1);
     107                qDebug("Connection::parseLine: asked to play file #%s.", index.toUtf8().data());
     108                sendText("OK, command sent to GUI.");
     109                emit receivedPlayItem(index.toInt());
     110        }
     111        else
     112        if (rx_removeItem.indexIn(str) > -1) {
     113                QString index = rx_removeItem.cap(1);
     114                qDebug("Connection::parseLine: asked to remove file %s.", index.toUtf8().data());
     115                sendText("OK, command sent to GUI.");
     116                emit receivedRemoveItem(index == "*" ? -1 : index.toInt());
     117        }
     118        else
     119        if (rx_moveItem.indexIn(str) > -1) {
     120                QString index = rx_moveItem.cap(1);
     121                QString shift = rx_moveItem.cap(2);
     122                qDebug("Connection::parseLine: asked to move file %s %s.", index.toUtf8().data(), shift.toUtf8().data());
     123                sendText("OK, command sent to GUI.");
     124                emit receivedMoveItem(index.toInt(), shift.toInt());
     125        }
     126        else
    88127        if (rx_open.indexIn(str) > -1) {
    89128                QString file = rx_open.cap(1);
     
    134173                emit receivedFunction(function);
    135174        }
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
    136221        else {
    137222                sendText("Unknown command");
     
    153238        c->setActionsList( actionsList() );
    154239
     240
     241
     242
     243
    155244        connect(c, SIGNAL(receivedOpen(QString)),
    156             this, SIGNAL(receivedOpen(QString)));
     245this, SIGNAL(receivedOpen(QString)));
    157246        connect(c, SIGNAL(receivedOpenFiles(QStringList)),
    158247            this, SIGNAL(receivedOpenFiles(QStringList)));
     
    163252        connect(c, SIGNAL(receivedLoadSubtitle(QString)),
    164253            this, SIGNAL(receivedLoadSubtitle(QString)));
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
    165270}
    166271
Note: See TracChangeset for help on using the changeset viewer.