📄 softmodem1.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#include <dir.h>
#pragma hdrstop
#include "Softmodem1.h"
#include "About.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Form1->Label2->Hide();
Form1->RichEdit2->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//int i=0; // variable used for count to display binary
//int n=0; // variable used to count elements in 8 bit increments
//int m=0;
count=0;
AnsiString GivenFileName = "transmit.txt"; // Sets the Filename to save to
AnsiString InputFileName = ExtractFilePath(Application->ExeName) + ExtractFileName(GivenFileName); //Extracts path & filename softmodem application
//Saves the Editbox characters to the file
//SaveToFile Opens,Saves & Closes a file
RichEdit1->Lines->SaveToFile(InputFileName);
//Loads the saved file and returns the amount of characters read
chars=LoadFile(filedata);
//Reads the characters and converts them to binary
readfile(chars, filedata);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Exit1Click(TObject *Sender)
{
Close(); //Exits from the program
}
//---------------------------------------------------------------------------
void __fastcall TForm1::About1Click(TObject *Sender)
{
AboutBox->ShowModal(); // Shows the about box
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
//Plays freqs based on binary one or zero
Direct_sound(chars, filedata);
//RichEdit2->Text = RichEdit2->Text + structdata[count];
//count++;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormActivate(TObject *Sender)
{
Main_Form_Handle = Form1->Handle;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -