~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/winskin/l33tFileInfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <noatunapp.h>
 
2
#include <noatunplaylist.h>
 
3
#include <qstring.h>
 
4
#include <qfile.h>
 
5
#include <qdatastream.h>
 
6
#include <iostream.h>
 
7
#include <kdebug.h>
 
8
 
 
9
#include "l33tFileInfo.h"
 
10
 
 
11
l33tFileInfo::l33tFileInfo(QString fileName)
 
12
{
 
13
        QFile f( fileName );
 
14
        cerr << fileName.latin1();
 
15
        f.open( IO_ReadOnly );
 
16
        QDataStream s( &f );
 
17
        s.readRawBytes(c, 4);
 
18
        f.close();
 
19
}
 
20
 
 
21
int l33tFileInfo::getBps()
 
22
{
 
23
        int bps = 0;
 
24
        int result;
 
25
        getbits(c[0], 0, 7, &result);
 
26
        int result2;
 
27
        getbits(c[0], 0, 3, &result2);
 
28
        cout << "\nHola, como estas?\n" << result<< "\nAdios amigo\n";
 
29
        if (result == 11111111)
 
30
        {
 
31
                switch(result2) {
 
32
                        case 0000: {
 
33
                                bps = 0;
 
34
                        }
 
35
                        case 0001: {
 
36
                                bps = 32;
 
37
                        }
 
38
                        case 0010: {
 
39
                                bps = 40;
 
40
                        }
 
41
                        case 0011: {
 
42
                                bps = 48;
 
43
                        }
 
44
                        case 0100: {
 
45
                                bps =  56;
 
46
                        }
 
47
                        case 0101: {
 
48
                                bps =  64;
 
49
                        }
 
50
                        case 0110: {
 
51
                                bps =  80;
 
52
                        }
 
53
                        case 0111: {
 
54
                                bps =  96;
 
55
                        }
 
56
                        case 1000: {
 
57
                                bps =  112;
 
58
                        }
 
59
                        case 1001: {
 
60
                                bps =  128;
 
61
                        }
 
62
                        case 1010: {
 
63
                                bps =  160;
 
64
                        }
 
65
                        case 1011: {
 
66
                                bps =  192;
 
67
                        }
 
68
                        case 1100: {
 
69
                                bps =  224;
 
70
                        }
 
71
                        case 1101: {
 
72
                                bps =  256;
 
73
                        }
 
74
                        case 1110: {
 
75
                                bps =  320;
 
76
                        }
 
77
                        case 1111: {
 
78
                                bps =  0;
 
79
                        }
 
80
                }
 
81
        }
 
82
        return bps;
 
83
}
 
84
 
 
85
int l33tFileInfo::getKHz()
 
86
{
 
87
 
 
88
}
 
89
 
 
90
QString l33tFileInfo::getChannelMode()
 
91
{
 
92
 
 
93
}
 
94
 
 
95
int l33tFileInfo::getbits(unsigned char x, int p, int n, int *result)
 
96
{
 
97
        for (int i=n; i > p;)
 
98
        {
 
99
                for (int i2 = p; i2 <= n; i2++)
 
100
                {
 
101
                        result[i2]=(x >> i) & 1;
 
102
                        i--;
 
103
                }
 
104
        }
 
105
}