void MediaObject::enqueue(const MediaSource &source) { K_D(MediaObject); if (d->mediaSource.type() == MediaSource::Invalid) { setCurrentSource(source); } else { d->sourceQueue << source; } }
void MediaObject::enqueue(const MediaSource &source) { K_D(MediaObject); if (!isPlayable(d->mediaSource.type())) { // the current source is nothing valid so this source needs to become the current one setCurrentSource(source); } else { d->sourceQueue << source; } }
// zero based char* DebugCLI::lineStart(int linenum) { if (!currentSource && currentFile) setCurrentSource(currentFile); if (!currentSource) { return NULL; } // linenumbers map to zero based array entry char *ptr = currentSource; for (int i=0; i<linenum; i++) { // Scan to end of line while (*ptr != '\n') { if (!*ptr) { return NULL; } ptr++; } // Advance past newline ptr++; } return ptr; }
void DebugCLI::enterDebugger() { setCurrentSource( (core->callStack) ? (core->callStack->filename()) : 0 ); if (currentSource == NULL) { stepInto(); return; } for (;;) { printIP(); core->console << "(asdb) "; fflush(stdout); fgets(commandLine, kMaxCommandLine, stdin); commandLine[strlen(commandLine)-1] = 0; if (!commandLine[0]) { strcpy(commandLine, lastCommand); } else { strcpy(lastCommand, commandLine); } currentToken = commandLine; char *command = nextToken(); int cmd = commandFor(command); switch (cmd) { case -1: // ambiguous, we already printed error message break; case CMD_INFO: info(); break; case CMD_BREAK: breakpoint(nextToken()); break; case CMD_DELETE: deleteBreakpoint(nextToken()); break; case CMD_LIST: list(nextToken()); break; case CMD_UNKNOWN: core->console << "Unknown command.\n"; break; case CMD_QUIT: exit(0); break; case CMD_CONTINUE: return; case CMD_PRINT: print(nextToken()); break; case CMD_NEXT: stepOver(); return; case INFO_STACK_CMD: bt(); break; case CMD_FINISH: stepOut(); return; case CMD_STEP: stepInto(); return; case CMD_SET: set(); break; default: core->console << "Command not implemented.\n"; break; } } }
void AudioOutput::setCurrentSource( QIODevice* stream ) { setCurrentSource( new MediaStream( stream ) ); }
void AudioOutput::setCurrentSource( const QUrl& stream ) { setCurrentSource( new MediaStream( stream ) ); }
void MediaObject::clear() { K_D(MediaObject); d->sourceQueue.clear(); setCurrentSource(MediaSource()); }