Skip to content

Commit

Permalink
A few fixes. Prepared v1.2.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
walkero-gr committed May 31, 2021
1 parent cc93c43 commit c3aea87
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 100 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.2.1] - 2021-05-31
### Fixed
- Reduced results to 20 as a temporary workaround of a bug that occurs with the default discovery of radio stations. Found where the problem is and it will be fixed on a later release.
- Disabled the load of the window when AmiSSL 4.9 is missing
- Fixed the exit of MediaVault when a library is not available
- Fixed the issue with duplicate results when "discover more" was clicked
- Fixed a crash that had to do with a broken API response. Now an info requester appears.

## [1.2.0] - 2021-05-27
### Added
- Added Unicode conversion to system charset on radio station names - Thanks to Daniel "trixie" Jedlicka
Expand Down
12 changes: 6 additions & 6 deletions MediaVault.cbp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<CodeBench_Project name="MediaVault" path="Applications:Programming&#047;workspace&#047;MyProjects&#047;mediavault&#047;MediaVault.cbp" created="1353847454" lastmodified="1369691602">
<CodeBench_Project name="MediaVault" path="Applications:Programming&#047;workspace&#047;MyProjects&#047;mediavault&#047;MediaVault.cbp" created="1353847454" lastmodified="1370026039">
<plugin name="PROGDIR:Plugins&#047;AmigaOS4SDK.CCPlugin" flags="0"/>
<target run="MediaVault"/>
<homedir name="Applications:Programming&#047;workspace&#047;MyProjects&#047;mediavault"/>
Expand Down Expand Up @@ -27,7 +27,7 @@
<file name="src&#047;mediavault.c" open="0"/>
<file name="src&#047;libshandler.c" open="0"/>
<file name="src&#047;upnpfuncs.c" open="0"/>
<file name="src&#047;gui.c" open="1" top="281" left="0" line="323" row="28"/>
<file name="src&#047;gui.c" open="1" current="1" top="281" left="0" line="323" row="28"/>
<file name="src&#047;httpfuncs.c" open="1" top="43" left="0" line="43" row="0"/>
<file name="src&#047;guifuncs.c" open="0"/>
<file name="src&#047;mainWin.c" open="1" top="139" left="0" line="147" row="26"/>
Expand All @@ -36,15 +36,15 @@
<file name="src&#047;stringfuncs.c" open="1" top="10" left="0" line="26" row="84"/>
</sources>
<others>
<file name="CHANGELOG.md" open="1" current="1" top="0" left="0" line="19" row="0"/>
<file name="README.md" open="1" top="0" left="0" line="34" row="18"/>
<file name="os4depot.readme" open="1" top="56" left="0" line="98" row="2"/>
<file name="CHANGELOG.md" open="0"/>
<file name="README.md" open="0"/>
<file name="os4depot.readme" open="0"/>
<file name="Makefile" open="0"/>
<file name=".gitignore" open="0"/>
</others>
<flags value="0x0000000000068001"/>
<buildscript name="Makefile" depth="3" open="0"/>
<projectnotes open="1" current="0" top="33" left="0" line="43" row="54"/>
<projectnotes open="0"/>
<buildwindow open="0"/>
<targets>
<target name="MediaVault" linker="gcc:bin&#047;gcc" switches="-lauto" flags="0x00000002">
Expand Down
44 changes: 20 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Requirements
* oo.library v1.13 by Tuomas Hokka
* jansson.library v2.12.1 by Simon Tyrrell
* AmigaAmp3 v3.29 by Thomas Wenzel
* AmiSSL 4.9 by the AmiSSL Open Source Team

I would like to thank
--------------------------
Expand Down Expand Up @@ -64,42 +65,37 @@ https://github.com/walkero-gr/mediavault/issues

Changelog
--------------------------

v1.2.1 - 2021-05-31
* Reduced results to 20 as a temporary workaround of a bug that occurs with the default discovery of radio stations. Found where the problem is and it will be fixed on a later release.
* Disabled the load of the window when AmiSSL 4.9 is missing
* Fixed the exit of MediaVault when a library is not available
* Fixed the issue with duplicate results when "discover more" was clicked
* Fixed a crash that had to do with a broken API response. Now an info requester appears.

v1.2.0 - 2021-05-27
* Added Unicode conversion to system charset on radio station names
- Thanks to Daniel "trixie" Jedlicka
* Now the application registers properly and can get requests from other
apps, like Exchanger - Thanks to Daniel "trixie" Jedlicka
* Now the MediaVault can jump to different screens - Thanks to Daniel
"trixie" Jedlicka
* Added better error manipulation when there were API response errors
- Thanks to Daniel "trixie" Jedlicka
* Now the size and the position of the window can be saved by the Popup
Gadget - Thanks to Daniel "trixie" Jedlicka
* Added code to detach the listbrowser before change it's data. That's the
way it should be done
* Restructured code to reduce the duplicated code in radiofuncs.c. Now, one
method is used instead of three separated that had pretty much the same
code. Better code, less problems.
* Added Unicode conversion to system charset on radio station names - Thanks to Daniel "trixie" Jedlicka
* Now the application registers properly and can get requests from other apps, like Exchanger - Thanks to Daniel "trixie" Jedlicka
* Now the MediaVault can jump to different screens - Thanks to Daniel "trixie" Jedlicka
* Added better error manipulation when there were API response errors - Thanks to Daniel "trixie" Jedlicka
* Now the size and the position of the window can be saved by the Popup Gadget - Thanks to Daniel "trixie" Jedlicka
* Added code to detach the listbrowser before change it's data. That's the way it should be done
* Restructured code to reduce the duplicated code in radiofuncs.c. Now, one method is used instead of three separated that had pretty much the same code. Better code, less problems.
* A lot of refactoring, removing global variables.
* Reduced a lot of duplicated code.
* Now the default radio station number increased to 50. The response is also
much faster - Thanks to Tuomas Hokka and oo.library 1.13 fixes
* Changed the way classes and gadgets are initiallized - Thanks to Daniel
"trixie" Jedlicka
* Now the default radio station number increased to 50. The response is also much faster - Thanks to Tuomas Hokka and oo.library 1.13 fixes
* Changed the way classes and gadgets are initiallized - Thanks to Daniel "trixie" Jedlicka

v1.1.1 - 2021-05-15
* Changed the required oo.library version to 1.12
* Fixed a bug on requesting radio stations without using the filters

v1.1.0 - 2021-05-13
* Added a message requester for messages to the user
* The "Discover" button changes to "Discover more" after the first search,
so to load more radio stations results. If the user change a filter, then
it resets.
* The "Discover" button changes to "Discover more" after the first search, so to load more radio stations results. If the user change a filter, then it resets.
* Added more options at the Genre select box
* Added more options at the countries and languages select boxes
* Now the retrieved radio stations list doesn't include the marked as broken
stations
* Now the retrieved radio stations list doesn't include the marked as broken stations
* Added Trending list of radio stations
* Added Popular list of radio stations
* Changed columns' widths on listbrowsers to be weighted
Expand Down
14 changes: 13 additions & 1 deletion os4depot.readme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mediavault
description: Discover online radio stations
version: 1.2.0
version: 1.2.1
author: George Sokianos
submitter: George Sokianos
email: walkero@gmail.com
Expand Down Expand Up @@ -43,6 +43,7 @@ Requirements
* oo.library v1.13 by Tuomas Hokka
* jansson.library v2.12.1 by Simon Tyrrell
* AmigaAmp3 v3.29 by Thomas Wenzel
* AmiSSL 4.9 by the AmiSSL Open Source Team

I would like to thank
--------------------------
Expand Down Expand Up @@ -73,6 +74,17 @@ https://github.com/walkero-gr/mediavault/issues

Changelog
--------------------------

v1.2.1 - 2021-05-31
* Reduced results to 20 as a temporary workaround of a bug that occurs with the
default discovery of radio stations. Found where the problem is and it will
be fixed on a later release.
* Disabled the load of the window when AmiSSL 4.9 is missing
* Fixed the exit of MediaVault when a library is not available
* Fixed the issue with duplicate results when "discover more" was clicked
* Fixed a crash that had to do with a broken API response. Now an info requester
appears.

v1.2.0 - 2021-05-27
* Added Unicode conversion to system charset on radio station names
- Thanks to Daniel "trixie" Jedlicka
Expand Down
5 changes: 2 additions & 3 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void showGUI(void)
res_node,
lsbNodeIdx;

// Main Window events
//// Main Window events
while ((result = IIntuition->IDoMethod(objects[OID_MAIN], WM_HANDLEINPUT, &code, TAG_DONE)))
{
switch (result & WMHI_CLASSMASK)
Expand Down Expand Up @@ -462,15 +462,14 @@ static void listStations(
net = NULL;
}

if (stationsCnt > 0)
if ((stationsCnt != ~0UL) && (stationsCnt > 0))
{
IIntuition->SetGadgetAttrs(listbrowser, windows[WID_MAIN], NULL,
LISTBROWSER_Labels, list,
LISTBROWSER_SortColumn, 0,
LISTBROWSER_Selected, -1,
LISTBROWSER_ColumnInfo, columnInfo,
TAG_DONE);

}
}

Expand Down
66 changes: 34 additions & 32 deletions src/libshandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,99 +78,101 @@ int CleanExit(const char *str)
IDOS->Printf("Error::%s\n",str);
return RETURN_ERROR;
}
return RETURN_OK;
}


void OpenLibs(void)
int OpenLibs(void)
{
//// Libraries
if ((ApplicationBase = IExec->OpenLibrary( "application.library", 53 )))
{
IApplication = (struct ApplicationIFace *)IExec->GetInterface( ApplicationBase, "application", 2, NULL );
if(!IApplication) CleanExit("Can't open application.library Interface");
if(!IApplication) return CleanExit("Can't open application.library Interface");
}
else CleanExit("Can't open application.library version 53");
else return CleanExit("Can't open application.library version 53");

if ((IntuitionBase = IExec->OpenLibrary( "intuition.library", 54 )))
{
if (LIB_IS_AT_LEAST(IntuitionBase, 54, 6))
{
IIntuition = (struct IntuitionIFace *)IExec->GetInterface( IntuitionBase, "main", 1, NULL );
if(!IIntuition) CleanExit("Can't open intuition.library Interface");
if(!IIntuition) return CleanExit("Can't open intuition.library Interface");
}
else CleanExit("Can't open intuition.library version 54.6 and above");
else return CleanExit("Can't open intuition.library version 54.6 and above");
}
else CleanExit("Can't open intuition.library version 54");
else return CleanExit("Can't open intuition.library version 54");

if ((UtilityBase = IExec->OpenLibrary( "utility.library", 53 )))
{
IUtility = (struct UtilityIFace *)IExec->GetInterface( UtilityBase, "main", 1, NULL );
if(!IUtility) CleanExit("Can't open utility.library Interface");
if(!IUtility) return CleanExit("Can't open utility.library Interface");
}
else CleanExit("Can't open utility.library version 53");
else return CleanExit("Can't open utility.library version 53");

if ((JanssonBase = IExec->OpenLibrary( "jansson.library", 2 )))
{
IJansson = (struct JanssonIFace *)IExec->GetInterface( JanssonBase, "main", 1, NULL );
if(!IJansson) CleanExit("Can't open jansson.library Interface");
if(!IJansson) return CleanExit("Can't open jansson.library Interface");
}
else CleanExit("Can't open jansson.library version 2");
else return CleanExit("Can't open jansson.library version 2");

if ((AmiSSLMasterBase = IExec->OpenLibrary("amisslmaster.library", 4 )))
{
if (!LIB_IS_AT_LEAST(AmiSSLMasterBase, 4, 9))
return CleanExit("Can't open amisslmaster.library version 4.9 and above");
}
else return CleanExit("Can't open amisslmaster.library version 4.9 and above");

if ((OOBase=IExec->OpenLibrary("oo.library", 1 )))
{
if (LIB_IS_AT_LEAST(OOBase, 1, 13))
{
IOO = (struct OOIFace *)IExec->GetInterface( OOBase, "main", 1, NULL );
if(!IOO) CleanExit("Can't open oo.library Interface");
if(!IOO) return CleanExit("Can't open oo.library Interface");
}
else CleanExit("Can't open oo.library version 1.13 and above");
}
else CleanExit("Can't open oo.library version 1.13 and above. Is it installed?");

if ((AmiSSLMasterBase = IExec->OpenLibrary("amisslmaster.library", 4 )))
{
if (!LIB_IS_AT_LEAST(AmiSSLMasterBase, 4, 9))
CleanExit("Can't open amisslmaster.library version 4.9 and above");
else return CleanExit("Can't open oo.library version 1.13 and above");
}
else CleanExit("Can't open amisslmaster.library version 4.9 and above");
else return CleanExit("Can't open oo.library version 1.13 and above. Is it installed?");

//// Classes and Gadgets opening
if ((ListBrowserBase = IIntuition->OpenClass( "gadgets/listbrowser.gadget", 1, &ListBrowserClass )))
{
IListBrowser = (struct ListBrowserIFace *)IExec->GetInterface( (struct Library *) ListBrowserBase, "main", 1, NULL );
if(!IListBrowser) CleanExit("Can't open ListBrowser Gadget Interface");
if(!IListBrowser) return CleanExit("Can't open ListBrowser Gadget Interface");
}
else CleanExit("Can't open ListBrowser");
else return CleanExit("Can't open ListBrowser");

WindowBase = IIntuition->OpenClass( "window.class", 53, &WindowClass );
if (!WindowBase) CleanExit("Can't open Window Class");
if (!WindowBase) return CleanExit("Can't open Window Class");

LayoutBase = IIntuition->OpenClass( "layout.gadget", 53, &LayoutClass );
if (!LayoutBase) CleanExit("Can't open Layout Gadget");
if (!LayoutBase) return CleanExit("Can't open Layout Gadget");

LabelBase = IIntuition->OpenClass( "label.image", 53, &LabelClass );
if (!LabelBase) CleanExit("Can't open Label Image");
if (!LabelBase) return CleanExit("Can't open Label Image");

ChooserBase = IIntuition->OpenClass( "chooser.gadget", 53, &ChooserClass );
if (!ChooserBase) CleanExit("Can't open Chooser Gadget");

ButtonBase = IIntuition->OpenClass( "button.gadget", 53, &ButtonClass );
if (!ButtonBase) CleanExit("Can't open Button Gadget");
if (!ButtonBase) return CleanExit("Can't open Button Gadget");

StringBase = IIntuition->OpenClass( "string.gadget", 53, &StringClass );
if (!StringBase) CleanExit("Can't open String Gadget");
if (!StringBase) return CleanExit("Can't open String Gadget");

ScrollerBase = IIntuition->OpenClass( "scroller.gadget", 53, &ScrollerClass );
if (!ScrollerBase) CleanExit("Can't open Scroller Gadget");
if (!ScrollerBase) return CleanExit("Can't open Scroller Gadget");

TextEditorBase = IIntuition->OpenClass( "texteditor.gadget", 53, &TextEditorClass );
if (!TextEditorBase) CleanExit("Can't open TextEditor Gadget");
if (!TextEditorBase) return CleanExit("Can't open TextEditor Gadget");

BitMapBase = IIntuition->OpenClass( "bitmap.image", 53, &BitMapClass );
if (!BitMapBase) CleanExit("Can't open BitMap Image");
if (!BitMapBase) return CleanExit("Can't open BitMap Image");

RequesterBase = IIntuition->OpenClass( "requester.class", 53, &RequesterClass );
if (!RequesterBase) CleanExit("Can't open Requester Class");
if (!RequesterBase) return CleanExit("Can't open Requester Class");

return RETURN_OK;
}
2 changes: 1 addition & 1 deletion src/libshandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#define _LIBSHANDLER_H

int CleanExit(const char *);
void OpenLibs(void);
int OpenLibs(void);

#endif
7 changes: 3 additions & 4 deletions src/mainWin.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ Object *buildMainWindow(struct MsgPort *appPort, Object *winMenu)
// END - Left Sidebar

LAYOUT_AddChild, gadgets[GID_PAGES] = radioPages,
//LAYOUT_WeightBar, TRUE,
/*
LAYOUT_WeightBar, TRUE,
// START - Right Sidebar
/*
LAYOUT_AddChild, IIntuition->NewObject(LayoutClass, NULL,
LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
Expand All @@ -233,9 +233,8 @@ Object *buildMainWindow(struct MsgPort *appPort, Object *winMenu)
TAG_DONE),
CHILD_WeightedWidth, 30,
CHILD_MinWidth, 200,
*/
// END - Right Sidebar

*/
TAG_DONE),
TAG_DONE),
TAG_DONE);
Expand Down
9 changes: 7 additions & 2 deletions src/mediavault.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ void die(const char *s)

int main(void)
{
int libsOpened;
libsOpened = OpenLibs();

OpenLibs();
if (libsOpened)
{
return libsOpened;
}

showGUI();
showGUI();
//discoverUPnPServers();
//freeUpnpServers();
//getMetadata((char *)"dummy");
Expand Down
Loading

0 comments on commit c3aea87

Please sign in to comment.