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

« back to all changes in this revision

Viewing changes to kscd/libwm/include/wm_cdtext.h

  • 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
#ifndef WM_CDTEXT_H
 
2
#define WM_CDTEXT_H
 
3
 
 
4
/***************************************************************************
 
5
                          wm_cdtext.h  -  description
 
6
                             -------------------
 
7
    begin                : Mon Feb 12 2001
 
8
    copyright            : (C) 2001 by Alex Kern
 
9
    email                : alex.kern@gmx.de
 
10
 ***************************************************************************/
 
11
 
 
12
/***************************************************************************
 
13
 *                                                                         *
 
14
 *   This program is free software; you can redistribute it and/or modify  *
 
15
 *   it under the terms of the GNU General Public License as published by  *
 
16
 *   the Free Software Foundation; either version 2 of the License, or     *
 
17
 *   (at your option) any later version.                                   *
 
18
 *                                                                         *
 
19
 ***************************************************************************/
 
20
 
 
21
/*
 
22
 * cdtext base structure and defines
 
23
 */
 
24
extern struct cdtext_info wm_cdtext_info;
 
25
 
 
26
#define MAX_LENGHT_OF_CDTEXT_STRING 162 /* max 160 bytes + 2 * 0x00 by UNICODES */
 
27
#define DATAFIELD_LENGHT_IN_PACK 12
 
28
#define MAX_LANGUAGE_BLOCKS 8
 
29
 
 
30
struct cdtext_pack_data_header {
 
31
  unsigned char header_field_id1_typ_of_pack;
 
32
  unsigned char header_field_id2_tracknumber;
 
33
  unsigned char header_field_id3_sequence;
 
34
  unsigned char header_field_id4_block_no;
 
35
  unsigned char text_data_field[DATAFIELD_LENGHT_IN_PACK];
 
36
  unsigned char crc_byte1;
 
37
  unsigned char crc_byte2;
 
38
};
 
39
 
 
40
typedef unsigned char cdtext_string[MAX_LENGHT_OF_CDTEXT_STRING];
 
41
 
 
42
/* meke it more generic
 
43
   it can be up to 8 blocks with different encoding */
 
44
 
 
45
struct cdtext_info_block {
 
46
  /* management */
 
47
  unsigned char block_code;
 
48
  unsigned char block_unicode; /* 0 - single chars, 1 - doublebytes */
 
49
  unsigned char block_encoding; /* orange book -? */
 
50
  cdtext_string* block_encoding_text;
 
51
 
 
52
  /* variable part of cdtext */
 
53
  cdtext_string* name;
 
54
  cdtext_string* performer;
 
55
  cdtext_string* songwriter;
 
56
  cdtext_string* composer;
 
57
  cdtext_string* arranger;
 
58
  cdtext_string* message;
 
59
  cdtext_string* UPC_EAN_ISRC_code;
 
60
 
 
61
  /* fix part of cdtext */
 
62
  unsigned char binary_disc_identification_info[DATAFIELD_LENGHT_IN_PACK];
 
63
  unsigned char binary_genreidentification_info[DATAFIELD_LENGHT_IN_PACK];
 
64
  unsigned char binary_size_information[DATAFIELD_LENGHT_IN_PACK];
 
65
};
 
66
 
 
67
struct cdtext_info {
 
68
  /* somethimes i get hunderts of bytes, without anyone valid pack
 
69
     my CDU-561 for example */
 
70
  int count_of_entries; /* one more becose album need one too */
 
71
  int count_of_valid_packs;
 
72
  int count_of_invalid_packs;
 
73
  int valid;
 
74
 
 
75
  struct cdtext_info_block *blocks[MAX_LANGUAGE_BLOCKS];
 
76
};
 
77
 
 
78
#ifndef IGNORE_FEATURE_LIST
 
79
 
 
80
struct feature_list_header {
 
81
  unsigned char lenght_msb;
 
82
  unsigned char lenght_1sb;
 
83
  unsigned char lenght_2sb;
 
84
  unsigned char lenght_lsb;
 
85
  unsigned char reserved1;
 
86
  unsigned char reserved2;
 
87
  unsigned char profile_msb;
 
88
  unsigned char profile_lsb;
 
89
};
 
90
 
 
91
struct feature_descriptor_cdread {
 
92
  unsigned char feature_code_msb;
 
93
  unsigned char feature_code_lsb;
 
94
  unsigned char settings;
 
95
  unsigned char add_lenght;
 
96
  unsigned char add_settings;
 
97
  unsigned char reserved1;
 
98
  unsigned char reserved2;
 
99
  unsigned char reserved3;
 
100
};
 
101
 
 
102
#endif /* IGNORE_FEATURE_LIST */
 
103
 
 
104
int wm_get_cdtext(struct wm_drive*);
 
105
void wm_free_cdtext(void);
 
106
 
 
107
#endif /* WM_CDTEXT_H */