Example #1
0
MainWindow::MainWindow () 
  : DocumentWindow (TRANS("DSP Filters"),
                    Colours::lightgrey, 
                    DocumentWindow::allButtons,
                    true)
{
  setResizable (true, false);
  
  MainPanel* contentComponent = new MainPanel;
  setMenuBar (contentComponent);
  setContentOwned (contentComponent, true);
  contentComponent->setAsConstrainerFor (this);
  ContentComponentConstrainer::attachTo (this);

  centreWithSize (getWidth(), getHeight());
  setVisible (true);
}
void StartModsLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("CHOOSE MOD");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_NAMEUP;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = FALSE;
  gmCurrent.gm_fnmDirectory = CTString("Mods\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".des");
  gmCurrent.gm_pAfterFileChosen = &LSLoadMod;

  gmCurrent.gm_pgmParentMenu = &_pGUIM->gmMainMenu;
  ChangeToMenu(&gmCurrent);
}
Example #3
0
// save TGA routine
void CImageInfo::SaveTGA_t( const CTFileName &strFileName) const // throw char *
{
  TGAHeader *pTGAHdr;
  UBYTE *pTGABuffer, *pTGAImage;
  SLONG slFileSize;
  PIX pixBitmapSize = ii_Width*ii_Height;
  CTFileStream TGAFile;

  // determine and check image info format
  SLONG slBytesPerPixel = ii_BitsPerPixel/8;
  ASSERT( slBytesPerPixel==3 || slBytesPerPixel==4);
  if( slBytesPerPixel!=3 && slBytesPerPixel!=4) throw( TRANS( "Unsupported BitsPerPixel in ImageInfo header."));

  // determine TGA file size and allocate memory
  slFileSize = sizeof(struct TGAHeader) + pixBitmapSize *slBytesPerPixel;
  pTGABuffer = (UBYTE*)AllocMemory( slFileSize);
  pTGAHdr    = (struct TGAHeader*)pTGABuffer;
  pTGAImage  = pTGABuffer + sizeof(struct TGAHeader);

  // set TGA picture size dimensions
  memset( pTGABuffer, 0x0, sizeof(struct TGAHeader));
  pTGAHdr->Width        = (UWORD)ii_Width;
  pTGAHdr->Height       = (UWORD)ii_Height;
  pTGAHdr->BitsPerPixel = (UBYTE)ii_BitsPerPixel;
  pTGAHdr->ImageType    = 2;

  // flip image vertically
  BOOL bAlphaChannel = (slBytesPerPixel==4);
  FlipBitmap( ii_Picture, pTGAImage, ii_Width, ii_Height, 1, bAlphaChannel);

  // convert CroTeam's pixel format to TGA format
  UBYTE *pubTmp = pTGAImage;  // need 'walking' pointer
  for( INDEX iPix=0; iPix<pixBitmapSize; iPix++)
  { // flip bytes
    Swap( pubTmp[0], pubTmp[2]);  // R & B channels
    pubTmp += slBytesPerPixel; 
  }

  // save entire TGA memory to file and close it
  TGAFile.Create_t( strFileName);
  TGAFile.Write_t( pTGABuffer, slFileSize);
  TGAFile.Close();

  // free temorary allocated memory for TGA image format
  FreeMemory( pTGABuffer);
}
Example #4
0
int
TRANS(NoListen) (char * protocol)

{
   Xtransport *trans;

   if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
   {
	PRMSG (1,"TRANS(TransNoListen): unable to find transport: %s\n",
	       protocol, 0, 0);

	return -1;
   }

   trans->flags |= TRANS_NOLISTEN;
   return 0;
}
/*
 *  Initialize client
 */
void CCommunicationInterface::Client_Init_t(char* strServerName)
{
  CTSingleLock slComm(&cm_csComm, TRUE);

  ASSERT(cci_bInitialized);
  ASSERT(!cci_bClientInitialized);

  // retrieve server address from server name
  ULONG ulServerAddress = StringToAddress(strServerName);
  // if lookup failed
  if (ulServerAddress==INADDR_NONE) {
    ThrowF_t(TRANS("Host '%s' not found!\n"), strServerName);
  }

  // call client init with server address
  Client_Init_t(ulServerAddress);
};
void VideoConfirm(void)
{
  CConfirmMenu &gmCurrent = _pGUIM->gmConfirmMenu;

  // FIXUP: keyboard focus lost when going from full screen to window mode
  // due to WM_MOUSEMOVE being sent
  _bMouseUsedLast = FALSE;
  _pmgUnderCursor = gmCurrent.gm_pmgSelectedByDefault;

  gmCurrent._pConfimedYes = NULL;
  gmCurrent._pConfimedNo = RevertVideoSettings;

  gmCurrent.gm_mgConfirmLabel.mg_strText = TRANS("KEEP THIS SETTING?");
  gmCurrent.gm_pgmParentMenu = pgmCurrentMenu;
  gmCurrent.BeLarge();
  ChangeToMenu(&gmCurrent);
}
void FilenameComponent::buttonClicked (Button*)
{
   #if JUCE_MODAL_LOOPS_PERMITTED
    FileChooser fc (TRANS("Choose a new file"),
                    getCurrentFile() == File::nonexistent ? defaultBrowseFile
                                                          : getCurrentFile(),
                    wildcard);

    if (isDir ? fc.browseForDirectory()
              : (isSaving ? fc.browseForFileToSave (false)
                          : fc.browseForFileToOpen()))
    {
        setCurrentFile (fc.getResult(), true);
    }
   #else
    jassertfalse; // needs rewriting to deal with non-modal environments
   #endif
}
Example #8
0
/*
  Creates lookup tables for some arithmetic functions
*/
void FloatFR_Init(void)
{
  int i;

  FLC_sub_start("FloatFR_Init");

  MULT(1); STORE(1);
  logDualisTable[0] = -1.0f; /* actually, ld 0 is not defined */

  PTR_INIT(1); /* logDualisTable[] */
  LOOP(1);
  for (i=1; i<LOG_DUALIS_TABLE_SIZE; i++) {
    TRANS(1); MULT(1); /* xxx * (1 / 0.30103) */ STORE(1);
    logDualisTable[i] = (float) ( log((float)i)/log(2.0f) );
  }
  
  FLC_sub_end();
}
void StartCustomLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("ADVANCED OPTIONS");
  gmCurrent.gm_bAllowThumbnails = FALSE;
  gmCurrent.gm_iSortType = LSSORT_NAMEUP;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = FALSE;
  gmCurrent.gm_fnmDirectory = CTString("Scripts\\CustomOptions\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".cfg");
  gmCurrent.gm_pAfterFileChosen = &LSLoadCustom;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
  ChangeToMenu(&gmCurrent);
}
Example #10
0
void StartControlsLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("LOAD CONTROLS");
  gmCurrent.gm_bAllowThumbnails = FALSE;
  gmCurrent.gm_iSortType = LSSORT_FILEUP;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = FALSE;
  gmCurrent.gm_fnmDirectory = CTString("Controls\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".ctl");
  gmCurrent.gm_pAfterFileChosen = &LSLoadControls;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = &_pGUIM->gmControls;
  ChangeToMenu(&gmCurrent);
}
Example #11
0
// -------- Save/Load Menu Calling Functions
void StartPlayerModelLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("CHOOSE MODEL");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_FILEUP;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = FALSE;
  gmCurrent.gm_fnmDirectory = CTString("Models\\Player\\");
  gmCurrent.gm_fnmSelected = _strLastPlayerAppearance;
  gmCurrent.gm_fnmExt = CTString(".amc");
  gmCurrent.gm_pAfterFileChosen = &LSLoadPlayerModel;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = &_pGUIM->gmPlayerProfile;
  ChangeToMenu(&gmCurrent);
}
Example #12
0
PopupMenu MenuBarItem::createPopupMenuWithItems (const StringArray& items)
{
    PopupMenu popupMenu;

    for (int i = 0; i < items.size(); ++i)
    {
        const int nextId = i + 1;

        const String& s = items.strings.getReference (i);

        if (s == "-")
            popupMenu.addSeparator();
        else
            popupMenu.addItem (nextId, TRANS (s));
    }

    return popupMenu;
}
	FindPanel()
		: caseButton ("Match Case"),
		findPrev ("<", "Search Previous"),
		findNext (">", "Search Next"),
		searchButton("", 0.0, Colours::white)
	{
		editor.setColour (CaretComponent::caretColourId, Colours::black);
		editor.addListener (this);
		addAndMakeVisible (editor);
		searchButton.addListener(this);
		addAndMakeVisible (searchButton);

		label.setText ("Find:", dontSendNotification);
		label.setColour (Label::textColourId, Colours::white);
		label.attachToComponent (&editor, true);

		searchInComboBox.setEditableText (false);
		searchInComboBox.setJustificationType (Justification::centredLeft);
		searchInComboBox.addItem (TRANS("Editor"), 1);
		searchInComboBox.addItem (TRANS("Output"), 2);
		searchInComboBox.addItem (TRANS("Methods"), 3);
		searchInComboBox.setSelectedItemIndex(0, dontSendNotification);
		searchInComboBox.addListener(this);
		searchInComboBox.setEnabled(false);
		addAndMakeVisible(searchInComboBox);

		addAndMakeVisible (caseButton);
		caseButton.setColour (ToggleButton::textColourId, Colours::white);
		caseButton.setToggleState (false, dontSendNotification);
		caseButton.addListener (this);

		lookInComboBox.setEditableText (false);
		lookInComboBox.setJustificationType (Justification::centredLeft);
		lookInComboBox.addItem (TRANS("Current"), 1);
		lookInComboBox.addItem (TRANS("All Open"), 2);
		lookInComboBox.addItem (TRANS("All"), 3);
		lookInComboBox.setSelectedItemIndex(0, dontSendNotification);
		lookInComboBox.addListener(this);
		addAndMakeVisible(lookInComboBox);

		findPrev.setConnectedEdges (Button::ConnectedOnRight);
		findPrev.addListener(this);
		findNext.setConnectedEdges (Button::ConnectedOnLeft);
		findNext.addListener(this);
		addAndMakeVisible (findPrev);
		addAndMakeVisible (findNext);

		setWantsKeyboardFocus (false);
		setFocusContainer (true);
		findPrev.setWantsKeyboardFocus (true);
		findNext.setWantsKeyboardFocus (true);
	}
Example #14
0
/*
Compute the inverse-matrix matrix product B = \alpha op(inv(A))B for
Side is CblasLeft and B = \alpha B op(inv(A)) for Side is
CblasRight. The matrix A is triangular and op(A) = A, A^T, A^H for
TransA = CblasNoTrans, CblasTrans, CblasConjTrans. When Uplo is
CblasUpper then the upper triangle of A is used, and when Uplo is
CblasLower then the lower triangle of A is used. If Diag is
CblasNonUnit then the diagonal of A is used, but if Diag is CblasUnit
then the diagonal elements of the matrix A are taken as unity and are
not referenced.
*/
int fff_blas_dtrsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, 
		    double alpha, const fff_matrix * A, fff_matrix * B)
{
  char* side = SWAP_SIDE(Side); 
  char* uplo = SWAP_UPLO(Uplo); 
  char* transa = TRANS(TransA); 
  char* diag = DIAG(Diag); 
  int m = B->size2; 
  int n = B->size1;
  int lda = (int) A->tda; 
  int ldb = (int) B->tda; 

  return( FNAME(dtrsm)(side, uplo, transa, diag, &m, &n, 
		       &alpha, 
		       A->data, &lda, 
		       B->data, &ldb) ); 
  
}
Example #15
0
void StartAddonsLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("EXECUTE ADDON");
  gmCurrent.gm_bAllowThumbnails = FALSE;
  gmCurrent.gm_iSortType = LSSORT_NAMEUP;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = FALSE;
  gmCurrent.gm_fnmDirectory = CTString("Scripts\\Addons\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".ini");
  gmCurrent.gm_pAfterFileChosen = &LSLoadAddon;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = &_pGUIM->gmOptionsMenu;
  ChangeToMenu(&gmCurrent);
}
Example #16
0
void AlertWindow::showMessageBoxAsync (AlertIconType iconType,
                                       const String& title,
                                       const String& message,
                                       const String& buttonText,
                                       Component* associatedComponent)
{
    if (LookAndFeel::getDefaultLookAndFeel().isUsingNativeAlertWindows())
    {
        return NativeMessageBox::showMessageBoxAsync (iconType, title, message, associatedComponent);
    }
    else
    {
        AlertWindowInfo info (title, message, associatedComponent, iconType, 1, 0, false);
        info.button1 = buttonText.isEmpty() ? TRANS("ok") : buttonText;

        info.invoke();
    }
}
// bind socket to the given address
void CCommunicationInterface::Bind_t(ULONG ulLocalHost, ULONG ulLocalPort)
{
  if (cci_hSocket==INVALID_SOCKET) {
    ASSERT(FALSE);
    return;
  }

  sockaddr_in sin;
  sin.sin_family = AF_INET;
  sin.sin_port = htons(ulLocalPort);
  sin.sin_addr.s_addr = htonl(ulLocalHost);

  // bind socket to server address/port
  if (bind(cci_hSocket, (sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR) {
    ThrowF_t(TRANS("Cannot bind socket. %s"), (const char*)GetSocketError(WSAGetLastError()));
  }
  cci_bBound = TRUE;
};
Example #18
0
static int
TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)

{
    struct t_call	*sndcall;
    struct sockaddr_un	*sunaddr;
    int			ret_value;

    prmsg(2, "TLITLIConnect(%s,%s)\n", host, port);

    if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_OPT|T_UDATA)) == NULL )
    {
	prmsg(1, "TLITLIConnect() failed to allocate a t_call\n");
	return TRANS_CONNECT_FAILED;
    }

    if( (sunaddr=(struct sockaddr_un *)
	 malloc(sizeof(struct sockaddr_un))) == NULL )
    {
	prmsg(1,
	      "TLITLIConnect: failed to allocate a sockaddr_un\n");
	t_free((char *)sndcall,T_CALL);
	return TRANS_CONNECT_FAILED;
    }

    sunaddr->sun_family=AF_UNIX;
    if( *port == '/' ||
	strncmp (port, TLINODENAME, strlen (TLINODENAME)) == 0) {
	/* Use the port as is */
	(void) strcpy(sunaddr->sun_path, port);
    } else {
	(void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port );
    }

    sndcall->addr.buf=(char *)sunaddr;
    sndcall->addr.len=sizeof(*sunaddr);
    sndcall->addr.maxlen=sizeof(*sunaddr);

    ret_value = TRANS(TLIConnect)(ciptr, sndcall );

    free((char *) sunaddr);

    return ret_value;
}
Example #19
0
// throws char *
void CTStream::GetLine_t(char *strBuffer, SLONG slBufferSize, char cDelimiter /*='\n'*/ )
{
  // check parameters
  ASSERT(strBuffer!=NULL && slBufferSize>0);
  // check that the stream can be read
  ASSERT(IsReadable());
  // letters slider
  INDEX iLetters = 0;
  // test if EOF reached
  if(AtEOF()) {
    ThrowF_t(TRANS("EOF reached, file %s"), (const char *) strm_strStreamDescription);
  }
  // get line from istream
  FOREVER
  {
    char c;
    Read_t(&c, 1);

    if(AtEOF()) {
      // cut off
      strBuffer[ iLetters] = 0;
      break;
    }

    // don't read "\r" characters but rather act like they don't exist
    if( c != '\r') {
      strBuffer[ iLetters] = c;
      // stop reading when delimiter loaded
      if( strBuffer[ iLetters] == cDelimiter) {
        // convert delimiter to zero
        strBuffer[ iLetters] = 0;
        // jump over delimiter
        //Seek_t(1, SD_CUR);
        break;
      }
      // jump to next destination letter
      iLetters++;
    }
    // test if maximum buffer lenght reached
    if( iLetters==slBufferSize) {
      return;
    }
  }
}
Example #20
0
// initialize/end the decoding support engine(s)
void CSoundDecoder::InitPlugins(void)
{
  try {
    // load vorbis
    if (_hOV==NULL) {
#ifndef NDEBUG
//안태훈 수정 시작	//(Exception Check & Fix)(0.1)
  #define VORBISLIB "vorbisfile.dll"
//  #define VORBISLIB "vorbisfile_d.dll"
//안태훈 수정 끝	//(Exception Check & Fix)(0.1)
#else
  #define VORBISLIB "vorbisfile.dll"
#endif
      _hOV = ::LoadLibrary(VORBISLIB);
    }
    if( _hOV == NULL) {
      ThrowF_t(TRANS("Cannot load vorbisfile.dll."));
    }
    // prepare function pointers
    OV_SetFunctionPointers_t();

    // if all successful, enable mpx playing
    _bOVEnabled = TRUE;
    CPrintF(TRANS("  vorbisfile.dll loaded, ogg playing enabled\n"));

  } catch (char *strError) {
    CPrintF(TRANS("OGG playing disabled: %s\n"), strError);
  }

  try {
    // load amp11lib
    if (_hAmp11lib==NULL) {
      _hAmp11lib = ::LoadLibrary( "amp11lib.dll");
    }
    if( _hAmp11lib == NULL) {
      ThrowF_t(TRANS("Cannot load amp11lib.dll."));
    }
    // prepare function pointers
    AMP11_SetFunctionPointers_t();

    // initialize amp11lib before calling any of its functions
    palInitLibrary();

    // if all successful, enable mpx playing
    _bAMP11Enabled = TRUE;
    CPrintF(TRANS("  amp11lib.dll loaded, mpx playing enabled\n"));

  } catch (char *strError) {
    CPrintF(TRANS("MPX playing disabled: %s\n"), strError);
  }
}
Example #21
0
//==============================================================================
void ImpleAudioProcessorEditor::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colour (0xff4d2323));

    g.setColour (Colour (0x88190803));
    g.fillRoundedRectangle (120.0f, 8.0f, 72.0f, 88.0f, 10.000f);

    g.setColour (Colours::white);
    g.setFont (Font (15.00f, Font::plain));
    g.drawText (TRANS("imple"),
                120, 16, 72, 72,
                Justification::centred, true);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}
//==============================================================================
KeyMappingEditorComponent::KeyMappingEditorComponent (KeyPressMappingSet& mappingManager,
                                                      const bool showResetToDefaultButton)
    : mappings (mappingManager),
      resetButton (TRANS ("reset to defaults"))
{
    treeItem = new TopLevelItem (*this);

    if (showResetToDefaultButton)
    {
        addAndMakeVisible (&resetButton);
        resetButton.addListener (treeItem);
    }

    addAndMakeVisible (&tree);
    tree.setColour (TreeView::backgroundColourId, findColour (backgroundColourId));
    tree.setRootItemVisible (false);
    tree.setDefaultOpenness (true);
    tree.setRootItem (treeItem);
}
Example #23
0
//==============================================================================
PageUPIS::PageUPIS (SunriseJobManager &jobManager)
    : SunriseJobResultListener(jobManager)
{
    addAndMakeVisible (batteryVoltageIcon = new SunriseIcon ("full_battery48_png"));
    addAndMakeVisible (temperatureIcon = new SunriseIcon ("temperature48_png"));
    addAndMakeVisible (currentIcon = new SunriseIcon ("pressure48_png"));
    addAndMakeVisible (eprVoltageIcon = new SunriseIcon ("car_battery48_png"));
    addAndMakeVisible (usbVoltageIcon = new SunriseIcon ("usb_on48_png"));
    addAndMakeVisible (batteryVoltageLabel = new SunriseValueLabel ("0.0 V"));
    addAndMakeVisible (currentUsageLabel = new SunriseValueLabel ("0.0 A"));
    addAndMakeVisible (temperatureLabel = new SunriseValueLabel ("00 C"));
    addAndMakeVisible (eprVoltageLabel = new SunriseValueLabel ("0.0 V"));
    addAndMakeVisible (usbVoltageLabel = new SunriseValueLabel ("0.0 V"));
    addAndMakeVisible (powerSourceIcon = new SunriseIcon ("question48_png"));
    addAndMakeVisible (chargerStatus = new SunriseIcon ("question48_png"));
    addAndMakeVisible (timeLapsedSinceLastUpdateLabel = new SunriseValueLabel ("0 s"));
    addAndMakeVisible (upisRTCDateAndTime = new SunriseValueLabel ("0 s"));
    addAndMakeVisible (onBatteryTime = new Label (String::empty,
                                                  TRANS("999:999")));
    onBatteryTime->setFont (Font (12.50f, Font::bold));
    onBatteryTime->setJustificationType (Justification::centred);
    onBatteryTime->setEditable (false, false, false);
    onBatteryTime->setColour (Label::textColourId, Colours::white);
    onBatteryTime->setColour (TextEditor::textColourId, Colours::black);
    onBatteryTime->setColour (TextEditor::backgroundColourId, Colour (0x00000000));


    //[UserPreSize]
    onBatteryTime->setVisible (false);
	currentPowerSource = Battery;
	onBatteryTime->setBufferedToImage(true);
    setBufferedToImage(true);
	timeElapsedSinceLastUpdate = 0;
	lastUpdateTime = switchedToBatteryTime = Time::getCurrentTime().toMilliseconds();
	startTimer (250);
    //[/UserPreSize]

    setSize (216, 280);


    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}
Example #24
0
void MTCSender::setDevice(int deviceIndex)
{
    m_deviceIndex = deviceIndex;
    if (deviceIndex == -1)
    {
        if (m_midiOutput)
        {
            delete m_midiOutput.release();
        }
        return;
    }

    m_midiOutput.reset(MidiOutput::openDevice(deviceIndex));

    if (!m_midiOutput)
    {
        AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, TRANS("Failed opening MIDI output device"), TRANS("The selected MIDI output device could not be opened."));
    }
}
Example #25
0
void CMGTrigger::Render(CDrawPort *pdp)
{
  SetFontMedium(pdp);

  PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
  PIX pixIL = box.Min()(1) + box.Size()(1)*0.45f;
  PIX pixIR = box.Min()(1) + box.Size()(1)*0.55f;
  PIX pixJ = box.Min()(2);

  COLOR col = GetCurrentColor();
  if (!mg_bVisual || mg_strValue == "") {
    CTString strValue = mg_strValue;
    if (mg_bVisual) {
      strValue = TRANS("none");
    }

    if (mg_iCenterI == -1) {
      pdp->PutText(mg_strLabel, box.Min()(1), pixJ, col);
      pdp->PutTextR(strValue, box.Max()(1), pixJ, col);
    } else {
      pdp->PutTextR(mg_strLabel, pixIL, pixJ, col);
      pdp->PutText(strValue, pixIR, pixJ, col);
    }
  } else {
    CTString strLabel = mg_strLabel + ": ";
    pdp->PutText(strLabel, box.Min()(1), pixJ, col);
    CTextureObject to;
    try {
      to.SetData_t(mg_strValue);
      CTextureData *ptd = (CTextureData *)to.GetData();
      PIX pixSize = box.Size()(2);
      PIX pixCX = box.Max()(1) - pixSize / 2;
      PIX pixCY = box.Center()(2);
      pdp->PutTexture(&to, PIXaabbox2D(
        PIX2D(pixCX - pixSize / 2, pixCY - pixSize / 2),
        PIX2D(pixCX - pixSize / 2 + pixSize, pixCY - pixSize / 2 + pixSize)), C_WHITE | 255);
    } catch (char *strError) {
      CPrintF("%s\n", strError);
    }
    to.SetData(NULL);
  }
}
BEGIN_JUCE_NAMESPACE

#include "juce_FileChooserDialogBox.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../../text/juce_LocalisedStrings.h"
#include "../windows/juce_AlertWindow.h"


//==============================================================================
FileChooserDialogBox::FileChooserDialogBox (const String& name,
                                            const String& instructions,
                                            FileBrowserComponent& chooserComponent,
                                            const bool warnAboutOverwritingExistingFiles_,
                                            const Colour& backgroundColour)
    : ResizableWindow (name, backgroundColour, true),
      warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_)
{
    content = new ContentComponent();
    content->setName (name);
    content->instructions = instructions;
    content->chooserComponent = &chooserComponent;

    content->addAndMakeVisible (&chooserComponent);

    content->okButton = new TextButton (chooserComponent.getActionVerb());
    content->addAndMakeVisible (content->okButton);
    content->okButton->addButtonListener (this);
    content->okButton->setEnabled (chooserComponent.currentFileIsValid());
    content->okButton->addShortcut (KeyPress (KeyPress::returnKey, 0, 0));

    content->cancelButton = new TextButton (TRANS("Cancel"));
    content->addAndMakeVisible (content->cancelButton);
    content->cancelButton->addButtonListener (this);
    content->cancelButton->addShortcut (KeyPress (KeyPress::escapeKey, 0, 0));

    setContentComponent (content);

    setResizable (true, true);
    setResizeLimits (300, 300, 1200, 1000);

    content->chooserComponent->addListener (this);
}
Example #27
0
void StartNetworkQuickLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  _gmMenuGameMode = GM_NETWORK;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("QUICK LOAD");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_FILEDN;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = TRUE;
  gmCurrent.gm_fnmDirectory = CTString("SaveGame\\Network\\Quick\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".sav");
  gmCurrent.gm_pAfterFileChosen = &LSLoadNetwork;
  SetQuickLoadNotes();

  gmCurrent.gm_pgmParentMenu = pgmCurrentMenu;
  ChangeToMenu(&gmCurrent);
}
Example #28
0
void StartSinglePlayerLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  _gmMenuGameMode = GM_SINGLE_PLAYER;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("LOAD");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_FILEDN;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = TRUE;
  gmCurrent.gm_fnmDirectory.PrintF("SaveGame\\Player%d\\", _pGame->gm_iSinglePlayer);
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".sav");
  gmCurrent.gm_pAfterFileChosen = &LSLoadSinglePlayer;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = pgmCurrentMenu;
  ChangeToMenu(&gmCurrent);
}
Example #29
0
void StartDemoLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  _gmMenuGameMode = GM_DEMO;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("PLAY DEMO");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_FILEDN;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = TRUE;
  gmCurrent.gm_fnmDirectory = CTString("Demos\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".dem");
  gmCurrent.gm_pAfterFileChosen = &LSLoadDemo;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = pgmCurrentMenu;
  ChangeToMenu(&gmCurrent);
}
Example #30
0
void StartSplitScreenLoadMenu(void)
{
  CLoadSaveMenu &gmCurrent = _pGUIM->gmLoadSaveMenu;

  _gmMenuGameMode = GM_SPLIT_SCREEN;

  gmCurrent.gm_mgTitle.mg_strText = TRANS("LOAD");
  gmCurrent.gm_bAllowThumbnails = TRUE;
  gmCurrent.gm_iSortType = LSSORT_FILEDN;
  gmCurrent.gm_bSave = FALSE;
  gmCurrent.gm_bManage = TRUE;
  gmCurrent.gm_fnmDirectory = CTString("SaveGame\\SplitScreen\\");
  gmCurrent.gm_fnmSelected = CTString("");
  gmCurrent.gm_fnmExt = CTString(".sav");
  gmCurrent.gm_pAfterFileChosen = &LSLoadSplitScreen;
  gmCurrent.gm_mgNotes.mg_strText = "";

  gmCurrent.gm_pgmParentMenu = pgmCurrentMenu;
  ChangeToMenu(&gmCurrent);
}