<commit_before>


#include "TMainWindow.h"
#include <Application.h>
#include <MenuItem.h>
#include <MenuBar.h>
#include <Menu.h>
#include <Directory.h>
#include <iostream>

using namespace org::toxic;
using namespace std;


TMainWindow::TMainWindow(BRect frame): BWindow(frame,"Guitar Master",B_TITLED_WINDOW,B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
{
	cout<<"Main window"<<endl;
	
	
	timer = new BMessageRunner(this,new BMessage(T_MSG_FRAME),50000,-1);
	
	BDirectory songs_dir("songs");
	
	if(songs_dir.InitCheck()!=B_OK)
	{
		cout<<"Songs dir not found"<<endl;	
	}
	else
	{
		cout<<"Found :"<<songs_dir.CountEntries()<<endl;	
	}
	
	ResizeTo(640,480);
	
	BRect bounds = Bounds();
	bounds.bottom = bounds.top + 15;
	BMenuBar * menubar = new BMenuBar(bounds,"main menu");
		
	
	BMenu * menu;
	BMenuItem * item;
	
	//Game menu
	menu = new BMenu("Game");
	//----items
	item = new BMenuItem("Quit",new BMessage(B_QUIT_REQUESTED),'Q');
	menu->AddItem(item);
	
	menubar->AddItem(menu);
	
	//Songs menu
	menu = new BMenu("Songs");
	// fill with available song list...
	menubar->AddItem(menu);
	
	AddChild(menubar);
	//menubar->ResizeToPreferred();
	<commit_msg>Songs listed on bmenu<commit_after>


#include "TMainWindow.h"
#include <Application.h>
#include <MenuItem.h>
#include <MenuBar.h>
#include <Menu.h>
#include <Directory.h>
#include <iostream>

using namespace org::toxic;
using namespace std;


TMainWindow::TMainWindow(BRect frame): BWindow(frame,"Guitar Master",B_TITLED_WINDOW,B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
{
	cout<<"Main window"<<endl;
	
	
	timer = new BMessageRunner(this,new BMessage(T_MSG_FRAME),50000,-1);
	
	
	
	ResizeTo(640,480);
	
	BRect bounds = Bounds();
	bounds.bottom = bounds.top + 15;
	BMenuBar * menubar = new BMenuBar(bounds,"main menu");
		
	
	BMenu * menu;
	BMenuItem * item;
	
	//Game menu
	menu = new BMenu("Game");
	//----items
	item = new BMenuItem("Quit",new BMessage(B_QUIT_REQUESTED),'Q');
	menu->AddItem(item);
	
	menubar->AddItem(menu);
	
	//Songs menu
	menu = new BMenu("Songs");
	// fill with available song list...
	cout<<"Reading songs directory..."<<endl;
	
	BDirectory songs_dir("songs");
	BEntry entry;
	char str[B_FILE_NAME_LENGTH];
	
	if(songs_dir.InitCheck()!=B_OK)
	{
		cout<<"Songs dir not found"<<endl;	
	}
	else
	{
		int num = songs_dir.CountEntries();
		cout<<"Found :"<<num<<endl;
		
		for(int i=0;i<num;i++)
		{
			songs_dir.GetNextEntry(&entry,false);
			entry.GetName(str);
			cout<<"name: "<<str<<endl;
			
			item = new BMenuItem(str,NULL);
			menu->AddItem(item);
				
		}	
	}
	menubar->AddItem(menu);
	
	//Play menu
	menu = new BMenu("Play");
	item = new BMenuItem("Easy",NULL);
	menu->AddItem(item);
	item = new BMenuItem("Normal",NULL);
	menu->AddItem(item);
	item = new BMenuItem("Amazing",NULL);
	menu->AddItem(item);
	menubar->AddItem(menu);
	
	
	AddChild(menubar);
	//menubar->ResizeToPreferred();
	
{'fraction_non_alphanumeric': 0.16969909027291813, 'fraction_numerical': 0.010146955913226032, 'mean_word_length': 4.594911937377691, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1494893', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1089, 'n_words': 207}