![]() |
Anzeige:
|
|
|||||||
| XProfan Alles rund um die Programmiersprache XProfan. |
|
![]() |
|
|
LinkBack | Themen-Optionen | Ansicht |
|
|
#1 (Direktlink) |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Ich möchte folgende Strukturen nach XProfan umsetzen:
Code:
typedef struct SDL_CDtrack {
Uint8 id; /**< Track number */
Uint8 type; /**< Data or audio track */
Uint16 unused;
Uint32 length; /**< Length, in frames, of this track */
Uint32 offset; /**< Offset, in frames, from start of disk */
} SDL_CDtrack;
/** This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD {
int id; /**< Private drive identifier */
CDstatus status; /**< Current drive status */
/** The rest of this structure is only valid if there's a CD in drive */
/*@{*/
int numtracks; /**< Number of tracks on disk */
int cur_track; /**< Current track position */
int cur_frame; /**< Current frame offset within current track */
SDL_CDtrack track[SDL_MAX_TRACKS+1];
/*@}*/
} SDL_CD;
Code:
Def SDL_MAX_TRACKS& = 99 Struct SDL_CDTRACK = id#(1), type#(1), unused%, length&, offset& Struct SDL_CD = id&, status&, numtracks&, cur_track&, cur_frame&, SDL_CDTRACK(SDL_MAX_TRACKS& + 1)' <-- ?? Wie setzt man das um? Gruß Thomas |
|
|
|
|
|
|
#2 (Direktlink) |
|
Weiß worum´s geht
![]() Registriert seit: 08.02.2009
Ort: Berlin
Beiträge: 226
|
Hallo Thomas,
hier liegt eher eine Vorhaltung als Vererbung vor da ich auch keine Zuweisungen als Pointer erkenne - an der Stelle "SDL_CDtrack track[SDL_MAX_TRACKS+1]" sollte einfach das Vorhalten von sizeof(SDL_CDtrack)*(SDL_MAX_TRACKS+1) Bytes schon funktionieren - vlt. kannst Du das mal so ausprobieren.
__________________
Programmieren für Anfänger. |
|
|
|
|
|
#3 (Direktlink) | |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Zitat:
Meinst Du, ich sollte an der Stelle lediglich eine Bereichsvariable stellen, in der passenden größe und den dort ankommenden pointer dann auf einer SDL_CDtrack strukturieren Bereich zuweisen? Sehr unkomfortabel. Eigentlich sollten strukturierte Typen in strukturen in XProfan doch funktionieren. Bloß als Array will das irgendwie nicht klappen. Vielleicht kommen ja noch andere Vorschläge, schließlich hab ich jede Menge solcher Strukturen umzusetzen Gruß Thomas |
|
|
|
|
|
|
#4 (Direktlink) |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Ich sehe schon, ich als Profan Anfänger muß das wohl alleine lösen
Soweit bin ich jetzt: Code:
Struct SDL_CD = id&, status&, numtracks&, cur_track&, cur_frame&, SDL_CDTRACK#(1200) Struct SDL_CDTRACK = id#(1), type#(1), unused%, length&, offset& Declare SDL_CDTRACK#[99], SDL_CD# Dim SDL_CDTRACK#[], SDL_CDTRACK Dim SDL_CD#, SDL_CD SDL_CDTRACK#[0] = SDL_CD#.SDL_CDTRACK# ' ist das so möglich? die Array-Bereichvariable. Vielleicht hat jemand sowas schon gemacht? Will auf jedenfall nicht mit OffsetOf * SizeOf usw. arbeiten. |
|
|
|
|
|
#5 (Direktlink) |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Hallo Thomas,
meinst Du etwas in dieser Art ? Code:
DEF &SDL_MAX_TRACKS 99 Struct SDL_CDTRACK = id#(1), type#(1), unused%, length&, offset& Struct SDL_CD = id&, status&, numtracks&, cur_track&, cur_frame&, CD!SDL_CDTRACK Declare SDL_CD#[&SDL_MAX_TRACKS] Dim SDL_CD#[],SDL_CD SDL_CD#[0].CD!offset& = 50 SDL_CD#[99].CD!offset& = 150 Print SDL_CD#[0].CD!offset& Print SDL_CD#[99].CD!offset& waitinput end
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
|
#6 (Direktlink) |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Hallo Andreas,
sieht schon mal sehr gut aus, bin mir aber nicht sicher, ob die Bereichsvariable auch 1220 Bytes groß ist. Mit SizeOf bekomme ich keinen korrekten Wert (kann auch daran liegen, das ich mit Bereichsvariablen immer noch auf Kriegsfuß stehe). Ich muss den Bereich ja an eine DLL übergeben. Die geht davon aus, das sie so viel Platz hat. Gruß Thomas |
|
|
|
|
|
#7 (Direktlink) | |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Zitat:
Für das, was Du da vorhast musst Du wohl einen Umweg gehen. In dieser Art etwa Code:
Def MoveMemory(3) !"KERNEL32","RtlMoveMemory" DEF &SDL_MAX_TRACKS 99 Struct SDL_CDTRACK = id#(1), type#(1), unused%, length&, offset& Struct SDL_CD = id&, status&, numtracks&, cur_track&, cur_frame&, SDL_CDTRACK#(1200) Var SD# = New(SDL_CD) Print "Strukturgrösse :";sizeof(sd#)," Bytes" Clear sd# 'hier zum lesen schicken 'dann auslesen Declare SDL_CDTRACK#[&SDL_MAX_TRACKS] Dim SDL_CDTRACK#[],SDL_CDTRACK 'Trackdaten kopieren MoveMemory(SDL_CDTRACK#[0],SD#+20,1200) Print SDL_CDTRACK#[0].offset& waitinput end
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
|
#8 (Direktlink) |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Danke Andreas, das sollte klappen!
Schön ist es trotzdem nicht Gruß Thomas |
|
|
|
|
|
#9 (Direktlink) |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Da ist mir grad' noch was eingefallen.
Kopieren ist vielleicht nicht nötig. Solte auch so SDL_CDTRACK#[0] = SD#+20 gehen.
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
#10 (Direktlink) |
|
Forenmaskottchen
![]() Registriert seit: 16.05.2010
Ort: Berlin
Beiträge: 724
|
Das wäre schon schöner, werde ich testen, danke.
|
|
|
|
|
![]() |
|
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Strukturen in C | TinaLehm | C/C++, Visual C++, Visual C++.NET | 3 | 12.09.2005 15:20 |
| Verständnisproblem WLAN - DRINGEND!- | Dakotasilver | Netzwerke | 0 | 14.03.2005 18:09 |
| Öffnen von Ordner(-strukturen) beschleunigen | xyz | Windows XP | 3 | 28.12.2004 22:12 |