Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void jpWindow::CalculateSize()
- {
- BFile f1;
- char temp_char[1024];
- char what[100];
- uint32 angle_temp[100];
- uint32 tracks, i;
- off_t temp, total_audio, total, total_iso, total_vrcd, total_duration;
- total_audio = 0;
- total = 0;
- total_iso = 0;
- total_vrcd = 0;
- total_duration = 0;
- temp = 0;
- nrtracks = 0;
- if (BURN_TYPE == 0) {
- sprintf(what, "Data");
- total_vrcd = total = total_iso = total_audio = 0;
- fStatusBar->SetBarColor(black);
- if (fLeftList->CountItems() > 0) {
- LeftListItem* item1 = (LeftListItem*)fLeftList->ItemAt(0);
- if (item1->fIconBitmap == fLeftList->fISOBitmap) {
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_iso += temp;
- angle_temp[0] = temp / 1024 / 1024;
- nrtracks = 1;
- } else if (item1->fIconBitmap == fLeftList->fVRCDBitmap) {
- nrtracks = 1;
- total_vrcd = temp = GetVRCDSize();
- angle_temp[0] = temp / 1024 / 1024;
- }
- }
- } else if (BURN_TYPE == 1) {
- sprintf(what, "AudioCD");
- total_vrcd = total = total_iso = total_audio = temp = 0;
- fStatusBar->SetBarColor(orange);
- if (fLeftList->CountItems() > 0) {
- LeftListItem* item1 = (LeftListItem*)fLeftList->ItemAt(0);
- LeftListItem* item2 = (LeftListItem*)fLeftList->ItemAt(1);
- if (item1->fIconBitmap == fLeftList->fAudioBitmap) {
- tracks = fLeftList->CountItems();
- for (i = 0; i < tracks; i++) {
- item1 = (LeftListItem*)fLeftList->ItemAt(i);
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_audio += temp;
- total_duration += item1->fAudioInfo.total_time;
- angle_temp[i] = temp / 1024 / 1024;
- nrtracks++;
- }
- } else if (fLeftList->CountItems() > 1) {
- if (item2->fIconBitmap == fLeftList->fAudioBitmap) {
- tracks = fLeftList->CountItems();
- for (i = 1; i < tracks; i++) {
- item1 = (LeftListItem*)fLeftList->ItemAt(i);
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_audio += temp;
- total_duration += item1->fAudioInfo.total_time;
- angle_temp[i - 1] = temp / 1024 / 1024;
- nrtracks++;
- }
- }
- }
- }
- } else if (BURN_TYPE == 2) {
- sprintf(what, "MixCD");
- total_vrcd = total = total_iso = total_audio = 0;
- fStatusBar->SetBarColor(greenblue);
- if (fLeftList->CountItems() > 0) {
- LeftListItem* item1 = (LeftListItem*)fLeftList->ItemAt(0);
- LeftListItem* item2 = (LeftListItem*)fLeftList->ItemAt(1);
- if (item1->fIconBitmap == fLeftList->fISOBitmap) {
- nrtracks = 1;
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_iso = temp;
- angle_temp[nrtracks - 1] = temp / 1024 / 1024;
- } else if (item1->fIconBitmap == fLeftList->fVRCDBitmap) {
- nrtracks = 1;
- total_vrcd = temp = GetVRCDSize();
- angle_temp[nrtracks - 1] = temp / 1024 / 1024;
- }
- if (item1->fIconBitmap == fLeftList->fAudioBitmap) {
- tracks = fLeftList->CountItems();
- for (i = 0; i < tracks; i++) {
- item1 = (LeftListItem*)fLeftList->ItemAt(i);
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_audio += temp;
- nrtracks++;
- angle_temp[nrtracks - 1] = temp / 1024 / 1024;
- }
- } else if (fLeftList->CountItems() > 1) {
- if (item2->fIconBitmap == fLeftList->fAudioBitmap) {
- tracks = fLeftList->CountItems();
- for (i = 1; i < tracks; i++) {
- item1 = (LeftListItem*)fLeftList->ItemAt(i);
- f1.SetTo(&item1->fRef, B_READ_ONLY);
- f1.GetSize(&temp);
- total_audio += temp;
- nrtracks++;
- angle_temp[nrtracks - 1] = temp / 1024 / 1024;
- }
- }
- }
- }
- }
- total = total_audio + total_iso + total_vrcd;
- if (BURN_TYPE == 1) {
- // Audio CD
- sprintf(temp_char, "%s - [%lld MB of 700 MB/%lld of 80 min (CD) / 4474 MB (DVD5) / 8140 MB (DVD9)]",
- what, total / 1024 / 1024, total_duration / 1000000);
- } else {
- sprintf(temp_char, "%s - [%lld MB of 700 MB (CD) / 4474 MB (DVD5) / 8140 MB (DVD9)]",
- what, total / 1024 / 1024);
- }
- fStatusBar->Reset();
- fStatusBar->SetMaxValue(CDSIZE);
- fStatusBar->Update((total / 1024 / 1024), temp_char);
- for (i = 0; i < nrtracks; i++) {
- if (i == 0)
- angles[i] = ((float)360 / (float)(total / 1024 / 1024)) * (float)angle_temp[i];
- else
- angles[i] = ((float)360 / (float)(total / 1024 / 1024)) * (float)angle_temp[i] + angles[i - 1];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement