Skip to content

Commit

Permalink
v0.10.0-alpha3
Browse files Browse the repository at this point in the history
  • Loading branch information
LTVA1 committed Sep 16, 2023
1 parent 7c8d17f commit 3e462e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion klystron
5 changes: 5 additions & 0 deletions src/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ void play_one_row(void *unused1, void *unused2, void *unused3)
mused.flags2 |= ((mused.song.flags & MUS_NO_REPEAT) ? NO_REPEAT_COPY : 0);
mused.song.flags |= MUS_NO_REPEAT;

mused.mus.flags |= MUS_ENGINE_PLAY_ONE_STEP;

debug("Playing one row");

play(MAKEPTR(1), 0, 0);
Expand Down Expand Up @@ -297,6 +299,7 @@ void stop(void *unused1, void *unused2, void *unused3)
}

mused.flags &= ~(SONG_PLAYING | LOOP_POSITION);
mused.mus.flags &= ~MUS_ENGINE_PLAY_ONE_STEP;
}


Expand Down Expand Up @@ -831,6 +834,7 @@ void export_wav_action(void *a, void *b, void *c)
char def[1000];

mused.song.flags |= MUS_NO_REPEAT; //wasn't there
mused.mus.flags &= ~MUS_ENGINE_PLAY_ONE_STEP;

if (strlen(mused.previous_song_filename) == 0)
{
Expand Down Expand Up @@ -896,6 +900,7 @@ void export_hires_wav_action(void *a, void*b, void*c)
char def[1000];

mused.song.flags |= MUS_NO_REPEAT; //wasn't there
mused.mus.flags &= ~MUS_ENGINE_PLAY_ONE_STEP;

if (strlen(mused.previous_song_filename) == 0)
{
Expand Down
14 changes: 7 additions & 7 deletions src/export.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2010 Tero Lindeman (kometbomb)
Copyright (c) 2009-2010 Tero Lindeman (kometbomb)
Copyright (c) 2021-2023 Georgy Saraykin (LTVA1 a.k.a. LTVA) and contributors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -114,13 +114,13 @@ bool export_wav(MusSong *song, CydWavetableEntry * entry, FILE *f, int channel)

if (song->song_length != 0)
{
int percentage = (mus->song_position + (channel == -1 ? 0 : (channel * song->song_length))) * 100 / (song->song_length * (channel == -1 ? 1 : song->num_channels));
SDL_Rect area = {domain->screen_w / 2 - 140, domain->screen_h / 2 - 24, 280, 48};
int percentage = (mus->song_position + (channel == -1 ? 0 : (channel * song->song_length))) * (area.w - (8 + 2) * 2) / (song->song_length * (channel == -1 ? 1 : song->num_channels));

if (percentage > last_percentage)
{
last_percentage = percentage;

SDL_Rect area = {domain->screen_w / 2 - 140, domain->screen_h / 2 - 24, 280, 48};
bevel(domain, &area, mused.slider_bevel, BEV_MENU);

adjust_rect(&area, 8);
Expand All @@ -131,7 +131,7 @@ bool export_wav(MusSong *song, CydWavetableEntry * entry, FILE *f, int channel)
adjust_rect(&area, 2);

int t = area.w;
area.w = area.w * percentage / 100;
area.w = area.w * percentage / area.w;

gfx_rect(domain, &area, colors[COLOR_PROGRESS_BAR]);

Expand Down Expand Up @@ -257,13 +257,13 @@ bool export_wav_hires(MusSong *song, CydWavetableEntry * entry, FILE *f, int cha

if (song->song_length != 0)
{
int percentage = (mus->song_position + (channel == -1 ? 0 : (channel * song->song_length))) * 100 / (song->song_length * (channel == -1 ? 1 : song->num_channels));
SDL_Rect area = {domain->screen_w / 2 - 140, domain->screen_h / 2 - 24, 280, 48};
int percentage = (mus->song_position + (channel == -1 ? 0 : (channel * song->song_length))) * (area.w - (8 + 2) * 2) / (song->song_length * (channel == -1 ? 1 : song->num_channels));

if (percentage > last_percentage)
{
last_percentage = percentage;

SDL_Rect area = {domain->screen_w / 2 - 140, domain->screen_h / 2 - 24, 280, 48};
bevel(domain, &area, mused.slider_bevel, BEV_MENU);

adjust_rect(&area, 8);
Expand All @@ -274,7 +274,7 @@ bool export_wav_hires(MusSong *song, CydWavetableEntry * entry, FILE *f, int cha
adjust_rect(&area, 2);

int t = area.w;
area.w = area.w * percentage / 100;
area.w = area.w * percentage / area.w;

gfx_rect(domain, &area, colors[COLOR_PROGRESS_BAR]);

Expand Down

0 comments on commit 3e462e4

Please sign in to comment.