summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/decoder/command.cpp
blob: 8b29efe61ccdce5cf031bef43b0efbf928ac0284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
  describes a command
  Copyright (C) 2000  Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */

#include "command.h"

#include <iostream>

using namespace std;

Command::Command(int id) {
  this->id=id;
  this->intArg=0;
}

Command::Command(int id,int arg) {
  this->id=id;
  this->intArg=arg;
}


Command::~Command() {
}


int Command::getID() {
  return id;
}


int Command::getIntArg() {
  return intArg;
}


void Command::copyTo(Command* dest) {
  dest->id=this->id;
  dest->intArg=this->intArg;
}

void Command::print(const char* text) { 
  cout << "COMMAND:"<<text<<endl;
  switch(id) {
  case _COMMAND_NONE:
    cout << "_COMMAND_NONE";
    break;
  case _COMMAND_PING:
    cout << "_COMMAND_PING";
    break;
  case _COMMAND_PAUSE:
    cout << "_COMMAND_PAUSE";
    break;
  case _COMMAND_PLAY:
    cout << "_COMMAND_PLAY";
    break;
  case _COMMAND_SEEK:
    cout << "_COMMAND_SEEK";
    cout << " intArg:"<<intArg;
    break;
  case _COMMAND_CLOSE:
    cout << "_COMMAND_CLOSE";
    break;
  case _COMMAND_START:
    cout << "_COMMAND_START";
    break;
  case _COMMAND_RESYNC_START:
    cout << "_COMMAND_RESYNC_START";
    break;
  case _COMMAND_RESYNC_END:
    cout << "_COMMAND_RESYNC_END";
    break;

  default:
    cout << "unknown command id in Command::print"<<endl;
  }
  cout << endl;
}