Example #1
0
        public void SetIntrument(SimpleApi saa, Instrument instrument, Harp harp)
        {
            harpIntrument = HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(harp);

            if (harpIntrument.InstrumentNotesDefinition.Count <= 0)
            {
                return;
            }

            var inn = harpIntrument.InstrumentNotesDefinition.Keys.Select(m => m).Where(kvp => kvp.BreathDirection == eBreathDirection.blow).Select(k => k.Slot).ToList();
        }
 public EncodingApi(IBitmovinApiClientFactory apiClientFactory)
 {
     Inputs           = new InputsApi(apiClientFactory);
     Outputs          = new OutputsApi(apiClientFactory);
     Configurations   = new ConfigurationsApi(apiClientFactory);
     Filters          = new FiltersApi(apiClientFactory);
     Encodings        = new EncodingsApi(apiClientFactory);
     Manifests        = new ManifestsApi(apiClientFactory);
     Infrastructure   = new InfrastructureApi(apiClientFactory);
     Statistics       = new StatisticsApi(apiClientFactory);
     WatchFolders     = new WatchFoldersApi(apiClientFactory);
     Simple           = new SimpleApi(apiClientFactory);
     ErrorDefinitions = new ErrorDefinitionsApi(apiClientFactory);
 }
Example #3
0
        /// <summary>
        /// Returns token that identifies autentication request sent to mobile device user
        /// </summary>
        /// <param name="purpose">Ignored.</param>
        /// <param name="manager">The <see cref="UserManager{TUser}"/> to retrieve the <paramref name="user"/> from.</param>
        /// <param name="user">The <typeparamref name="TUser"/>.</param>
        /// <returns>string.Empty.</returns>
        public virtual Task <string> GenerateAsync(string purpose, UserManager <TUser> manager, TUser user)
        {
            /**
             * 1. The first task is to bind a SimpleApi instance to an API (endpoint + access_id combination)
             * After the api instance is bound to the remote API, it can be used to perform other operations.
             *
             * NOTE: before you are bound to an application, do not use any other functions!
             */

            var api = new SimpleApi();

            var uuidSequence = Observable.Defer <string>(() => api.CreateAuthRequest(user.ToString(), _ntkOpts.ActionTitle, "Example authentication request from .NET CORE 2.0", (int)_ntkOpts.MessageTtlSeconds));

            var full = api
                       .Bind(_ntkOpts.ServiceURL, _ntkOpts.ServiceID)
                       .SingleAsync()
                       .Select(_ => "")
                       .Concat(uuidSequence);

            return(full.ToTask());
        }
Example #4
0
        /*
         * public void PlayOff(AirSlotAttributesClass HarpSlot, SimpleApi sa, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
         *  KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *  foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *  {
         *      if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot - notediff))
         *      {
         *          instrument = ins;
         *          break;
         *      }
         *  }
         *
         *  if (instrument.Value != null)
         *  {
         *      //sa.SetTranspose(transpose);
         *      byte playByte = instrument.Value.GetNoteByte();
         *
         *      sa.NoteOff(playByte);
         *  }
         * }
         */
        public void PlayOff(AirSlotAttributesClass HarpSlot, SimpleApi sa)
        {
            KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass>();

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
            {
                if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
                {
                    instrument = ins;
                    break;
                }
            }

            if (instrument.Value != null)
            {
                //sa.SetTranspose(transpose);
                byte playByte = instrument.Value.GetNoteByte();

                sa.NoteOff(playByte);
            }
        }
Example #5
0
        /// <summary>
        /// Checks if authentication request is valid and returns request state - Approved, Rejected, Pending
        /// When Pending == false, authentication flow can proceed.
        /// ResponsePayloadBase64 field in response contains payload with signature from mobile device
        /// You can re-validate signature in XML payload with standard PKI toolset (validation is already done in NAS)
        /// Fingerprint element in XML can be used to track actual device, if user has multiple
        /// Model ApprovalRequestResponse comes from Notakey.SDK API
        /// </summary>
        /// <param name="Uuid"></param>
        /// <returns></returns>
        public virtual Task <ApprovalRequestResponse> TwoFactorNotakeyAuthState(string Uuid)
        {
            if (string.IsNullOrWhiteSpace(Uuid))
            {
                throw new Exception("Invalid auth request UUID");
            }


            var api = new SimpleApi();

            var authSequence = Observable.Defer <ApprovalRequestResponse>(() => api.CheckResponse(Uuid));

            var full = api
                       .Bind(_ntkOpts.ServiceURL, _ntkOpts.ServiceID)
                       .SingleAsync()
                       .Select(_ => new ApprovalRequestResponse())
                       .Concat(authSequence)
                       .LastAsync();


            return(full.ToTask());
        }
Example #6
0
        /*
         * public int GetHarpSlotnDiff(AirSlotAttributesClass HarpSlot, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = 0;
         *  if (this.Name != refHarpInstrument.Name)
         *  {
         *      //Referenzinstument ist diffeernt, es muß die R0wDiff errechnet werden
         *
         *      KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *      KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrumentRef = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *
         *      foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *      {
         *          if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
         *          {
         *              instrument = ins;
         *              break;
         *          }
         *      }
         *
         *      foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in refHarpInstrument.InstrumentNotesDefinition)
         *      {
         *          if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
         *          {
         *              instrumentRef = ins;
         *              break;
         *          }
         *      }
         *
         *      if (instrumentRef.Value != null && instrument.Value != null)
         *      {
         *          notediff = instrument.Value.NoteDiff - instrumentRef.Value.NoteDiff;
         *      }
         *  }
         *  return notediff;
         * }
         */
        /*
         * public byte Play(AirSlotAttributesClass HarpSlot, SimpleApi sa, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
         *  KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *
         *  foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *  {
         *      if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot - notediff))
         *      {
         *          instrument = ins;
         *          break;
         *      }
         *  }
         *  byte playByte = 0;
         *
         *  if (instrument.Value != null)
         *  {
         *
         *      playByte = instrument.Value.GetNoteByte();
         *      //sa.SetTranspose(transpose);
         *      sa.NoteOn(playByte);
         *  }
         *  return playByte;
         * }
         */
        public byte Play(AirSlotAttributesClass HarpSlot, SimpleApi sa)
        {
            //int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
            KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass>();

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
            {
                if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
                {
                    instrument = ins;
                    break;
                }
            }
            byte playByte = 0;

            if (instrument.Value != null)
            {
                playByte = instrument.Value.GetNoteByte();
                //sa.SetTranspose(transpose);
                sa.NoteOn(playByte);
            }
            return(playByte);
        }
Example #7
0
        public int Create(Control parent, Control songTextControl, SimpleApi saa, Instrument instrument, Harp harp)
        {
            FormInstances.Instance().hc.ActualHarpInstrument = HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(harp);

            if (FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition.Count <= 0)
            {
                return(0);
            }

            var inn = FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition.Keys.Select(m => m).Where(kvp => kvp.BreathDirection == eBreathDirection.blow).Select(k => k.Slot).ToList();

            gb         = new GroupBox();
            gb.Parent  = parent;
            gb.Width   = (inn.Count + 1) * (Statics.SlotButtonWitdh + 2) + 16;
            gb.Height  = 500;
            gb.Left    = 8;
            gb.Top     = 16;
            gb.Text    = string.Empty; //harp.Name;
            gb.Dock    = DockStyle.Left;
            gb.Visible = true;
            //Für alle im Instrument definierten HarpSlotn wird die UI angelegt
            int witdh = 0;

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> inf in FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition)
            {
                if (inf.Key.BreathDirection == eBreathDirection.blow)
                {
                    witdh += 1;
                }
                AirSlotClass aslot = new AirSlotClass(gb, songTextControl, inf, FormInstances.Instance().sa);

                Slots.Add(aslot);
            }

            return((witdh * (Statics.SlotButtonWitdh + 2)) + 86);
        }
Example #8
0
 async Task SendRefitRequest()
 {
     TestCustomerDto customer = await SimpleApi.SomeAction(new TestCustomerDto { Id = Guid.NewGuid(), Name = "Test" }, CancellationToken.None);
 }
Example #9
0
 public void PlayOff(byte playByte, SimpleApi sa)
 {
     sa.NoteOff(playByte);
 }
Example #10
0
        public AirSlotClass(Control parent, Control SongTextControl, KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> ins, SimpleApi simpleApi)
        {
            SongText            = (RichTextBox)SongTextControl;
            slotUpper           = new Button();
            slotUpper.Left      = (ins.Value.HarpSlot * (Statics.SlotButtonWitdh + 2)) + 8;
            slotUpper.Top       = 16;
            slotUpper.Width     = 48;
            slotUpper.Height    = 24;
            slotUpper.Parent    = parent;
            slotUpper.BackColor = Color.Bisque;
            slotUpper.TextAlign = ContentAlignment.MiddleCenter;
            slotUpper.Text      = (ins.Value.HarpSlot).ToString();

            slot = new NoteButton();

            slot.Left = (ins.Value.HarpSlot * (Statics.SlotButtonWitdh + 2)) + 8;

            if (ins.Value.HarpSlot == 1)
            {
                slotLeft           = new Button();
                slotLeft.Enabled   = false;
                slotLeft.Parent    = parent;
                slotLeft.BackColor = Color.Bisque;

                slotLeft.Left   = 2;
                slotLeft.Height = 24;
                slotLeft.Width  = 54;
            }


            if (ins.Key.BreathDirection == eBreathDirection.blow)
            {
                if (ins.Value.HarpSlot == 1)
                {
                    slotLeft.Text = "blow";
                    slotLeft.Top  = 28 + slotUpper.Height;
                }
                slot.Top         = 16 + slotUpper.Height;
                slot.MouseDown  += Slot_MouseDownBlow;
                slot.ColorPushed = blowColor;
            }
            else if (ins.Key.BreathDirection == eBreathDirection.draw)
            {
                if (ins.Value.HarpSlot == 1)
                {
                    slotLeft.Text = "draw";
                    slotLeft.Top  = 48 + 28 + slotUpper.Height;
                }
                slot.Top         = 48 + 16 + slotUpper.Height;
                slot.MouseDown  += Slot_MouseDownDraw;
                slot.ColorPushed = drawColor;
            }
            else if (ins.Key.BreathDirection == eBreathDirection.blowPushed)
            {
                if (ins.Value.HarpSlot == 1)
                {
                    slotLeft.Text = "blow-p";
                    slotLeft.Top  = 2 * 48 + 28 + slotUpper.Height;
                }
                slot.Top         = 2 * 48 + 16 + slotUpper.Height;
                slot.MouseDown  += Slot_MouseDownBlow;
                slot.ColorPushed = blowColor;
            }
            else if (ins.Key.BreathDirection == eBreathDirection.drawPushed)
            {
                if (ins.Value.HarpSlot == 1)
                {
                    slotLeft.Text = "draw-p";
                    slotLeft.Top  = 3 * 48 + 28 + slotUpper.Height;
                }
                slot.Top         = 3 * 48 + 16 + slotUpper.Height;
                slot.MouseDown  += Slot_MouseDownDraw;
                slot.ColorPushed = drawColor;
            }
            slot.Width     = Statics.SlotButtonWitdh; //48
            slot.Height    = 48;
            slot.Parent    = parent;
            slot.BackColor = Color.LightGray;
            slot.TextAlign = ContentAlignment.MiddleCenter;

            slot.Tag = ins;

            slot.Text = $@"{ins.Value.Note}";
            sa        = simpleApi;

            slot.MouseUp += Slot_MouseUp;
        }