Einzelnen Beitrag anzeigen

totti14

Registriert seit: 26. Mai 2005
Ort: Bremen
90 Beiträge
 
Delphi 10.3 Rio
 
#1

C++ nach Delphi

  Alt 19. Nov 2006, 00:07
Hallöchen,
Ich habe eine kleines C++ File welches ich gerne nach Pascal übersetzen würde.
Leider habe ich von C nur ein paar Grundkenntnisse.
Könnte mir jemand diese beiden Schnipsel mal Übersetzen /Erklären:
Danke schonmal
Thorsten



Code:
//filter.cpp
FILTER::FILTER()
{
filter_type = FLAT_FILTER;
filter_function = NO_FILTERING;
order = 1;
num_of_sections = 1;
fs = SAMPLE_RATE;
fc = fs/2.0;

bq = new BIQUAD *;
*bq = new BIQUAD;

(*bq)->DesignBiquad(FLAT,fs,fc,0.0,0.0);
}
//-----------------------------
void FILTER::Allocate(void)
{
u32 ci;

bq = new BIQUAD *[num_of_sections];

for(ci = 0;ci < FILTER::num_of_sections;ci++) FILTER::bq[ci] = new BIQUAD;
}

void FILTER::Deallocate(void)
{
u32 ci;

for(ci = 0;ci < FILTER::num_of_sections;ci++) delete bq[ci];

delete bq;
}
//-----------------------------
FILTER::~FILTER()
{
FILTER::Deallocate();
}
//=====================================================================
//Filter.h
class FILTER
{
FILTER_TYPE filter_type;
FILTER_FUNCTION filter_function;

u32 order;          // order
u32 num_of_sections; // number of biquad sections in filter
f64 fs;            // sample rate
f64 fc;            // cutoff

BIQUAD **bq; // array of pointers

    void Deallocate(void);
    void Allocate(void);

public:
    FILTER();
    ~FILTER();
    void DesignFilter(FILTER_TYPE filter_type,FILTER_FUNCTION filter_function, f64 fs, f64 fc, u32 order);    
    };
  Mit Zitat antworten Zitat