Skip to content

Commit

Permalink
Fix OS4 menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
sacredbanana committed Aug 10, 2024
1 parent f14a9df commit 5aab454
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Changelog

## 1.6.0 (2024-08-08)
## 1.6.0 (2024-08-10)

- Add the GPT4o Mini model
- Remove the unused Accent menu item from OS4 version
- Fix bug where some voice menu items in the OS4 version dont get a checkmark after you select it

## 1.5.1 (2024-06-26)

Expand Down
4 changes: 3 additions & 1 deletion bundle/AmigaGPT/AmigaGPT.guide
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,11 @@ Training data: Up to Sep 2021
@node changelog "Changelog"
@{b}Changelog@{ub}

@{b}1.6.0 (2024-08-08)@{ub}
@{b}1.6.0 (2024-08-10)@{ub}

- Add the GPT4o Mini model
- Remove the unused Accent menu item from OS4 version
- Fix bug where some voice menu items in the OS4 version dont get a checkmark after you select it

@{b}1.5.1 (2024-06-26)@{ub}

Expand Down
5 changes: 4 additions & 1 deletion bundle/AmigaGPT/AmigaGPT.readme
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,13 @@ Special Thanks:
Changelog:

------------------
1.6.0 (2024-08-08)
1.6.0 (2024-08-10)
------------------

- Add the GPT4o Mini model
- Remove the unused Accent menu item from OS4 version
- Fix bug where some voice menu items in the OS4 version dont get a checkmark
after you select it

------------------
1.5.1 (2024-06-26)
Expand Down
27 changes: 16 additions & 11 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ static struct NewMenu amigaGPTMenu[] = {
{NM_SUB, "Flite", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_FLITE_ID},
#endif
{NM_SUB, "OpenAI Text To Speech", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_OPENAI_ID},
#ifdef __AMIGAOS3__
{NM_ITEM, "Accent", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_ACCENT_ID},
#endif
#ifdef __AMIGAOS4__
{NM_ITEM, "Flite Voice", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_FLITE_VOICE_ID},
{NM_SUB, "kal (fast)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_FLITE_VOICE_KAL_ID},
Expand All @@ -270,7 +273,6 @@ static struct NewMenu amigaGPTMenu[] = {
{NM_SUB, "rms (slow)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_FLITE_VOICE_RMS_ID},
{NM_SUB, "slt (slow)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_FLITE_VOICE_SLT_ID},
#endif
{NM_ITEM, "Accent", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_ACCENT_ID},
{NM_ITEM, "OpenAI Voice", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_OPENAI_ID},
{NM_SUB, "alloy", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_SPEECH_OPENAI_VOICE_ALLOY_ID},
{NM_SUB, "echo", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_OPENAI_VOICE_ECHO_ID},
Expand Down Expand Up @@ -1819,7 +1821,7 @@ static void sendChatMessage() {
static void updateMenu() {
#ifdef __AMIGAOS3__
APTR *visualInfo;
ULONG error = NULL;
ULONG error = 0;
FreeMenus(menu);
if (visualInfo = GetVisualInfo(screen, NULL)) {
if (menu = CreateMenus(amigaGPTMenu, GTMN_SecondaryError, &error, TAG_DONE)) {
Expand Down Expand Up @@ -1848,7 +1850,7 @@ static void updateMenu() {
**/
static void refreshOpenAIMenuItems() {
struct NewMenu *newMenu = amigaGPTMenu;
while (newMenu->nm_UserData != MENU_ITEM_CHAT_MODEL_ID) {
while ((int)newMenu->nm_UserData != MENU_ITEM_CHAT_MODEL_ID) {
newMenu++;
}

Expand All @@ -1861,7 +1863,7 @@ static void refreshOpenAIMenuItems() {
}
}

while (newMenu->nm_UserData != MENU_ITEM_IMAGE_MODEL_ID) {
while ((int)newMenu->nm_UserData != MENU_ITEM_IMAGE_MODEL_ID) {
newMenu++;
}

Expand All @@ -1873,7 +1875,7 @@ static void refreshOpenAIMenuItems() {
}
}

while (newMenu->nm_UserData != MENU_ITEM_IMAGE_SIZE_DALL_E_2_ID) {
while ((int)newMenu->nm_UserData != MENU_ITEM_IMAGE_SIZE_DALL_E_2_ID) {
newMenu++;
}

Expand All @@ -1885,7 +1887,7 @@ static void refreshOpenAIMenuItems() {
}
}

while (newMenu->nm_UserData != MENU_ITEM_IMAGE_SIZE_DALL_E_3_ID) {
while ((int)newMenu->nm_UserData != MENU_ITEM_IMAGE_SIZE_DALL_E_3_ID) {
newMenu++;
}

Expand All @@ -1905,7 +1907,7 @@ static void refreshOpenAIMenuItems() {
**/
static void refreshSpeechMenuItems() {
struct NewMenu *newMenu = amigaGPTMenu;
while (newMenu->nm_UserData != MENU_ITEM_SPEECH_ENABLED_ID) {
while ((int)newMenu->nm_UserData != MENU_ITEM_SPEECH_ENABLED_ID) {
newMenu++;
}

Expand All @@ -1922,11 +1924,10 @@ static void refreshSpeechMenuItems() {
newMenu->nm_Flags &= ~CHECKED;
}
}
newMenu++;

#ifdef __AMIGAOS4__
while ((++newMenu)->nm_Type == NM_SUB) {
CONST_STRPTR currentFliteVoiceName = SPEECH_FLITE_VOICE_NAMES[config.speechFliteVoice];

// Find the length of the first word in the label
UBYTE labelLen = 0;
while (newMenu->nm_Label[labelLen] != ' ') {
Expand All @@ -1935,15 +1936,19 @@ static void refreshSpeechMenuItems() {

// Compare the first word of the label with currentVoiceName
// We have to do this because the (slow) warnings were appended to the label
if (strncmp(newMenu->nm_Label, currentFliteVoiceName, labelLen) == 0 &&
currentFliteVoiceName[labelLen] == '\0') {
if (strncmp(newMenu->nm_Label, currentFliteVoiceName, labelLen) == 0 && currentFliteVoiceName[labelLen] == '\0') {
newMenu->nm_Flags |= CHECKED;
} else {
newMenu->nm_Flags &= ~CHECKED;
}
}
#endif

#ifdef __AMIGAOS3__
// Skip the Accent menu
newMenu++;
#endif

while ((++newMenu)->nm_Type == NM_SUB) {
CONST_STRPTR currentOpenAITTSVoiceName = OPENAI_TTS_VOICE_NAMES[config.openAITTSVoice];

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define APP_VERSION "1.6.0"
#define BUILD_NUMBER "3014"
#define BUILD_NUMBER "3024"
#define APP_NAME "AmigaGPT"

0 comments on commit 5aab454

Please sign in to comment.